id
int32
0
241k
repo
stringlengths
6
63
path
stringlengths
5
140
func_name
stringlengths
3
151
original_string
stringlengths
84
13k
language
stringclasses
1 value
code
stringlengths
84
13k
code_tokens
list
docstring
stringlengths
3
47.2k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
91
247
200,800
GetOlympus/olympus-social-field
src/Social/Social.php
Social.hex2rgb
protected function hex2rgb($hexcolor) { preg_match("/^#{0,1}([0-9a-f]{1,6})$/i", $hexcolor, $match); if (!isset($match[1])) { return []; } $color = $match[1]; #91d04d if (6 == strlen($color)) { list($r, $g, $b) = [ $color[0]...
php
protected function hex2rgb($hexcolor) { preg_match("/^#{0,1}([0-9a-f]{1,6})$/i", $hexcolor, $match); if (!isset($match[1])) { return []; } $color = $match[1]; #91d04d if (6 == strlen($color)) { list($r, $g, $b) = [ $color[0]...
[ "protected", "function", "hex2rgb", "(", "$", "hexcolor", ")", "{", "preg_match", "(", "\"/^#{0,1}([0-9a-f]{1,6})$/i\"", ",", "$", "hexcolor", ",", "$", "match", ")", ";", "if", "(", "!", "isset", "(", "$", "match", "[", "1", "]", ")", ")", "{", "retur...
Return RGB array from hex color. @param string $hexcolor @return array $rgb
[ "Return", "RGB", "array", "from", "hex", "color", "." ]
aaa38a7e796c79386a3261c599de02082029c280
https://github.com/GetOlympus/olympus-social-field/blob/aaa38a7e796c79386a3261c599de02082029c280/src/Social/Social.php#L348-L395
200,801
nativgames-old/pegase
src/Pegase/Core/Path/Service/Path.php
Path.get_html_path
public function get_html_path($resource_path) { //pointe vers /web/$path // étape 1: mettre un chemin relatif, donc rajouter tous les "../" nécessaires $uri = $this->sm->get('pegase.core.request')->get_uri(); $uri = explode('?', $uri); $uri = $uri[0]; $nb = substr_count($uri, '/') - 1; ...
php
public function get_html_path($resource_path) { //pointe vers /web/$path // étape 1: mettre un chemin relatif, donc rajouter tous les "../" nécessaires $uri = $this->sm->get('pegase.core.request')->get_uri(); $uri = explode('?', $uri); $uri = $uri[0]; $nb = substr_count($uri, '/') - 1; ...
[ "public", "function", "get_html_path", "(", "$", "resource_path", ")", "{", "//pointe vers /web/$path", "// étape 1: mettre un chemin relatif, donc rajouter tous les \"../\" nécessaires ", "$", "uri", "=", "$", "this", "->", "sm", "->", "get", "(", "'pegase.core.request'", ...
relatif, pour les liens dans le html
[ "relatif", "pour", "les", "liens", "dans", "le", "html" ]
9a00e09a26f391c988aadecd7640c72316eaa521
https://github.com/nativgames-old/pegase/blob/9a00e09a26f391c988aadecd7640c72316eaa521/src/Pegase/Core/Path/Service/Path.php#L28-L58
200,802
Dhii/stringable-helper-base
src/StringableSplitCapableTrait.php
StringableSplitCapableTrait._stringableSplit
protected function _stringableSplit($subject, $separator) { $subject = $this->_normalizeString($subject); $separator = $this->_normalizeString($separator); return explode($separator, $subject); }
php
protected function _stringableSplit($subject, $separator) { $subject = $this->_normalizeString($subject); $separator = $this->_normalizeString($separator); return explode($separator, $subject); }
[ "protected", "function", "_stringableSplit", "(", "$", "subject", ",", "$", "separator", ")", "{", "$", "subject", "=", "$", "this", "->", "_normalizeString", "(", "$", "subject", ")", ";", "$", "separator", "=", "$", "this", "->", "_normalizeString", "(",...
Splits a stringable into pieces using a separator. @since [*next-version*] @param string|Stringable $subject The string to split. @param string|Stringable $separator The separator to split by. @throws InvalidArgumentException If the subject or the separator are invalid. @return array|stdClass|Traversable The list...
[ "Splits", "a", "stringable", "into", "pieces", "using", "a", "separator", "." ]
904254409800710665135a751659b59d140a2b40
https://github.com/Dhii/stringable-helper-base/blob/904254409800710665135a751659b59d140a2b40/src/StringableSplitCapableTrait.php#L29-L35
200,803
pdyn/filesystem
FilesystemUtils.php
FilesystemUtils.get_mime_type
public static function get_mime_type($filename) { if (extension_loaded('fileinfo')) { try { $finfo = new \finfo(FILEINFO_MIME_TYPE); return $finfo->file($filename); } catch (\Exception $e) { // Try next option... } } if (function_exists('mime_content_type')) { try { return mime_conten...
php
public static function get_mime_type($filename) { if (extension_loaded('fileinfo')) { try { $finfo = new \finfo(FILEINFO_MIME_TYPE); return $finfo->file($filename); } catch (\Exception $e) { // Try next option... } } if (function_exists('mime_content_type')) { try { return mime_conten...
[ "public", "static", "function", "get_mime_type", "(", "$", "filename", ")", "{", "if", "(", "extension_loaded", "(", "'fileinfo'", ")", ")", "{", "try", "{", "$", "finfo", "=", "new", "\\", "finfo", "(", "FILEINFO_MIME_TYPE", ")", ";", "return", "$", "fi...
Determine the mime-type of a file. @param string $filename The full, absolute path to a file. @return string The mime type.
[ "Determine", "the", "mime", "-", "type", "of", "a", "file", "." ]
e2f780eac166aa60071e601d600133b860ace594
https://github.com/pdyn/filesystem/blob/e2f780eac166aa60071e601d600133b860ace594/FilesystemUtils.php#L35-L61
200,804
pdyn/filesystem
FilesystemUtils.php
FilesystemUtils.normalize_filename
public static function normalize_filename($input) { if (empty($input)) { return false; } $pathinfo = pathinfo($input); // Normalize extension. $ext = mb_strtolower($pathinfo['extension']); if ($ext === 'jpeg') { $ext = 'jpg'; } // Rebuild filename. $filename = $pathinfo['filename'].'.'.$ext; ...
php
public static function normalize_filename($input) { if (empty($input)) { return false; } $pathinfo = pathinfo($input); // Normalize extension. $ext = mb_strtolower($pathinfo['extension']); if ($ext === 'jpeg') { $ext = 'jpg'; } // Rebuild filename. $filename = $pathinfo['filename'].'.'.$ext; ...
[ "public", "static", "function", "normalize_filename", "(", "$", "input", ")", "{", "if", "(", "empty", "(", "$", "input", ")", ")", "{", "return", "false", ";", "}", "$", "pathinfo", "=", "pathinfo", "(", "$", "input", ")", ";", "// Normalize extension."...
This helps us create normalized filenames. As the point of this function is to alter the input, the result should not be used to refer to the original, but instead used as a normalized name for storing new files. @param string $input The input filename. @return string Normalized filename.
[ "This", "helps", "us", "create", "normalized", "filenames", "." ]
e2f780eac166aa60071e601d600133b860ace594
https://github.com/pdyn/filesystem/blob/e2f780eac166aa60071e601d600133b860ace594/FilesystemUtils.php#L72-L92
200,805
pdyn/filesystem
FilesystemUtils.php
FilesystemUtils.sanitize_filename
public static function sanitize_filename($i, $allow_subdirs = false, $allowabsolute = false) { $i = trim($i); $replacements = ['../', './']; if ($allow_subdirs === false) { $replacements[] = '/'; } if ($allowabsolute !== true && $i{0} === '/') { $i = substr($i, 1); } return str_replace($replacements...
php
public static function sanitize_filename($i, $allow_subdirs = false, $allowabsolute = false) { $i = trim($i); $replacements = ['../', './']; if ($allow_subdirs === false) { $replacements[] = '/'; } if ($allowabsolute !== true && $i{0} === '/') { $i = substr($i, 1); } return str_replace($replacements...
[ "public", "static", "function", "sanitize_filename", "(", "$", "i", ",", "$", "allow_subdirs", "=", "false", ",", "$", "allowabsolute", "=", "false", ")", "{", "$", "i", "=", "trim", "(", "$", "i", ")", ";", "$", "replacements", "=", "[", "'../'", ",...
Sanitize a filename. Specifically, this removes directory traversal via ./ and ../ @param string $i The input value. @param boolean $allow_subdirs Whether to allow forward directory traversal (i.e. subdirectories). @return string The sanitized string.
[ "Sanitize", "a", "filename", "." ]
e2f780eac166aa60071e601d600133b860ace594
https://github.com/pdyn/filesystem/blob/e2f780eac166aa60071e601d600133b860ace594/FilesystemUtils.php#L103-L113
200,806
pdyn/filesystem
FilesystemUtils.php
FilesystemUtils.create_directory_structure
public static function create_directory_structure($folders, $base_dir) { if (!empty($folders) && is_array($folders)) { foreach ($folders as $name => $subfolders) { if (!file_exists($base_dir.$name.'/')) { mkdir($base_dir.$name.'/'); } touch($base_dir.$name.'/index.html'); if (!empty($subfolder...
php
public static function create_directory_structure($folders, $base_dir) { if (!empty($folders) && is_array($folders)) { foreach ($folders as $name => $subfolders) { if (!file_exists($base_dir.$name.'/')) { mkdir($base_dir.$name.'/'); } touch($base_dir.$name.'/index.html'); if (!empty($subfolder...
[ "public", "static", "function", "create_directory_structure", "(", "$", "folders", ",", "$", "base_dir", ")", "{", "if", "(", "!", "empty", "(", "$", "folders", ")", "&&", "is_array", "(", "$", "folders", ")", ")", "{", "foreach", "(", "$", "folders", ...
Create a complete directory structure in a given path. @param array $folders An array representing the structure to be created. Keys are folder names, values are arrays of subfolders (with keys being names and values being subfolders, etc) @param string $base_dir The directory to create the structure in. Must include ...
[ "Create", "a", "complete", "directory", "structure", "in", "a", "given", "path", "." ]
e2f780eac166aa60071e601d600133b860ace594
https://github.com/pdyn/filesystem/blob/e2f780eac166aa60071e601d600133b860ace594/FilesystemUtils.php#L122-L134
200,807
pdyn/filesystem
FilesystemUtils.php
FilesystemUtils.rrmdir
public static function rrmdir($path) { if (is_file($path)) { return unlink($path); } elseif (is_dir($path)) { $dir_members = scandir($path); foreach ($dir_members as $member) { if ($member !== '.' && $member !== '..') { static::rrmdir($path.'/'.$member); } } return @rmdir($path); } }
php
public static function rrmdir($path) { if (is_file($path)) { return unlink($path); } elseif (is_dir($path)) { $dir_members = scandir($path); foreach ($dir_members as $member) { if ($member !== '.' && $member !== '..') { static::rrmdir($path.'/'.$member); } } return @rmdir($path); } }
[ "public", "static", "function", "rrmdir", "(", "$", "path", ")", "{", "if", "(", "is_file", "(", "$", "path", ")", ")", "{", "return", "unlink", "(", "$", "path", ")", ";", "}", "elseif", "(", "is_dir", "(", "$", "path", ")", ")", "{", "$", "di...
Delete a folder and all subfolders. @param string $path The absolute path to the folder to delete. @return bool Success/Failure.
[ "Delete", "a", "folder", "and", "all", "subfolders", "." ]
e2f780eac166aa60071e601d600133b860ace594
https://github.com/pdyn/filesystem/blob/e2f780eac166aa60071e601d600133b860ace594/FilesystemUtils.php#L142-L154
200,808
pdyn/filesystem
FilesystemUtils.php
FilesystemUtils.unzip
public static function unzip($file, $destination) { if (!file_exists($file)) { return false; } if (!file_exists($destination)) { mkdir($destination); } if (class_exists('ZipArchive')) { $result = static::unzip_using_ziparchive($file, $destination); if ($result === true) { return true; } ...
php
public static function unzip($file, $destination) { if (!file_exists($file)) { return false; } if (!file_exists($destination)) { mkdir($destination); } if (class_exists('ZipArchive')) { $result = static::unzip_using_ziparchive($file, $destination); if ($result === true) { return true; } ...
[ "public", "static", "function", "unzip", "(", "$", "file", ",", "$", "destination", ")", "{", "if", "(", "!", "file_exists", "(", "$", "file", ")", ")", "{", "return", "false", ";", "}", "if", "(", "!", "file_exists", "(", "$", "destination", ")", ...
Unzip a zip file into a directory. @param string $file The absolute path to a zip file. @param string $destination The absolute path to the directory to unzip to file into. @return bool Success/Failure.
[ "Unzip", "a", "zip", "file", "into", "a", "directory", "." ]
e2f780eac166aa60071e601d600133b860ace594
https://github.com/pdyn/filesystem/blob/e2f780eac166aa60071e601d600133b860ace594/FilesystemUtils.php#L163-L180
200,809
pdyn/filesystem
FilesystemUtils.php
FilesystemUtils.unzip_using_ziparchive
public static function unzip_using_ziparchive($file, $destination) { $za = new \ZipArchive; $zares = $za->open($file); if ($zares === true) { $za->extractTo($destination); $za->close(); return true; } else { return false; } }
php
public static function unzip_using_ziparchive($file, $destination) { $za = new \ZipArchive; $zares = $za->open($file); if ($zares === true) { $za->extractTo($destination); $za->close(); return true; } else { return false; } }
[ "public", "static", "function", "unzip_using_ziparchive", "(", "$", "file", ",", "$", "destination", ")", "{", "$", "za", "=", "new", "\\", "ZipArchive", ";", "$", "zares", "=", "$", "za", "->", "open", "(", "$", "file", ")", ";", "if", "(", "$", "...
Unzip a file into a directory using the ZipArchive class. @param string $file The absolute path to a zip file. @param string $destination The absolute path to the directory to unzip to file into. @return bool Success/Failure.
[ "Unzip", "a", "file", "into", "a", "directory", "using", "the", "ZipArchive", "class", "." ]
e2f780eac166aa60071e601d600133b860ace594
https://github.com/pdyn/filesystem/blob/e2f780eac166aa60071e601d600133b860ace594/FilesystemUtils.php#L189-L199
200,810
pdyn/filesystem
FilesystemUtils.php
FilesystemUtils.get_file_type_from_mime
public static function get_file_type_from_mime($mime) { $validtypes = ['application', 'audio', 'image', 'message', 'multipart', 'text', 'video']; if (mb_stripos($mime, '/') === false) { // Malformed mime type. return false; } $iparts = explode('/', $mime); if (count($iparts) !== 2) { // Malformed m...
php
public static function get_file_type_from_mime($mime) { $validtypes = ['application', 'audio', 'image', 'message', 'multipart', 'text', 'video']; if (mb_stripos($mime, '/') === false) { // Malformed mime type. return false; } $iparts = explode('/', $mime); if (count($iparts) !== 2) { // Malformed m...
[ "public", "static", "function", "get_file_type_from_mime", "(", "$", "mime", ")", "{", "$", "validtypes", "=", "[", "'application'", ",", "'audio'", ",", "'image'", ",", "'message'", ",", "'multipart'", ",", "'text'", ",", "'video'", "]", ";", "if", "(", "...
Get the general file type from a mime type. This returns the beginning part (before the slash) of a mime type, giving a more general category of the file. @param string $mime The mime type. @return string The general file type.
[ "Get", "the", "general", "file", "type", "from", "a", "mime", "type", "." ]
e2f780eac166aa60071e601d600133b860ace594
https://github.com/pdyn/filesystem/blob/e2f780eac166aa60071e601d600133b860ace594/FilesystemUtils.php#L209-L224
200,811
pdyn/filesystem
FilesystemUtils.php
FilesystemUtils.make_human_readable_filesize
public static function make_human_readable_filesize($bytes) { $units = array('B', 'KB', 'MB', 'GB', 'TB', 'PB'); $num_units = count($units); $size = $bytes; foreach ($units as $i => $unit) { if ($size < 1024 || (($i + 1) === $num_units)) { return round($size, 2).$unit; } $size = $size / 1024; } ...
php
public static function make_human_readable_filesize($bytes) { $units = array('B', 'KB', 'MB', 'GB', 'TB', 'PB'); $num_units = count($units); $size = $bytes; foreach ($units as $i => $unit) { if ($size < 1024 || (($i + 1) === $num_units)) { return round($size, 2).$unit; } $size = $size / 1024; } ...
[ "public", "static", "function", "make_human_readable_filesize", "(", "$", "bytes", ")", "{", "$", "units", "=", "array", "(", "'B'", ",", "'KB'", ",", "'MB'", ",", "'GB'", ",", "'TB'", ",", "'PB'", ")", ";", "$", "num_units", "=", "count", "(", "$", ...
Convert bytes into a human-readable format. For example: $bytes = 1024 would return 1KB, $bytes = 1048576 would return 1MB, etc. @param int $bytes The number of bytes to convert. @return string The human readable representation of the bytes.
[ "Convert", "bytes", "into", "a", "human", "-", "readable", "format", "." ]
e2f780eac166aa60071e601d600133b860ace594
https://github.com/pdyn/filesystem/blob/e2f780eac166aa60071e601d600133b860ace594/FilesystemUtils.php#L257-L268
200,812
pdyn/filesystem
FilesystemUtils.php
FilesystemUtils.dirsize
public static function dirsize($dir, $createifmissing = false) { $dirsize = 0; if (!file_exists($dir)) { if ($createifmissing === true) { mkdir($dir); return 0; } throw new \Exception('Directory does not exist!', 400); } $dir_info = scandir($dir); if ($dir{(mb_strlen($dir) - 1)} !== '/') { ...
php
public static function dirsize($dir, $createifmissing = false) { $dirsize = 0; if (!file_exists($dir)) { if ($createifmissing === true) { mkdir($dir); return 0; } throw new \Exception('Directory does not exist!', 400); } $dir_info = scandir($dir); if ($dir{(mb_strlen($dir) - 1)} !== '/') { ...
[ "public", "static", "function", "dirsize", "(", "$", "dir", ",", "$", "createifmissing", "=", "false", ")", "{", "$", "dirsize", "=", "0", ";", "if", "(", "!", "file_exists", "(", "$", "dir", ")", ")", "{", "if", "(", "$", "createifmissing", "===", ...
Get the disk usage of a given directory. @param string $dir The absolute path to the directory to get the disk usage of. @return int The disk usage of the directory in bytes.
[ "Get", "the", "disk", "usage", "of", "a", "given", "directory", "." ]
e2f780eac166aa60071e601d600133b860ace594
https://github.com/pdyn/filesystem/blob/e2f780eac166aa60071e601d600133b860ace594/FilesystemUtils.php#L276-L305
200,813
net-tools/core
src/Helpers/FileHelper.php
FileHelper.guessMimeType
static function guessMimeType($file, $def = 'application/octet-stream') { // extract file extension (after . symbol) $ext = substr(strrchr(strtolower($file), '.'), 1); switch ( $ext ) { case 'gif': case 'jpeg': case 'png': return "image/$ext"; case 'jpg': return 'image/jpeg'; case 'mp4...
php
static function guessMimeType($file, $def = 'application/octet-stream') { // extract file extension (after . symbol) $ext = substr(strrchr(strtolower($file), '.'), 1); switch ( $ext ) { case 'gif': case 'jpeg': case 'png': return "image/$ext"; case 'jpg': return 'image/jpeg'; case 'mp4...
[ "static", "function", "guessMimeType", "(", "$", "file", ",", "$", "def", "=", "'application/octet-stream'", ")", "{", "// extract file extension (after . symbol)", "$", "ext", "=", "substr", "(", "strrchr", "(", "strtolower", "(", "$", "file", ")", ",", "'.'", ...
Guess Mime type from file name @param string $file Filename to process @param string $def Default value for Mime type @return string The Mime type guessed from the filename
[ "Guess", "Mime", "type", "from", "file", "name" ]
51446641cee22c0cf53d2b409c76cc8bd1a187e7
https://github.com/net-tools/core/blob/51446641cee22c0cf53d2b409c76cc8bd1a187e7/src/Helpers/FileHelper.php#L89-L144
200,814
Rockbeat-Sky/yii
src/db/ActiveRecord.php
ActiveRecord.getConstants
public static function getConstants($name) { if (isset(self::$_const[$name])) { return self::$_const[$name]; } $self = new \ReflectionClass(new static()); $contants = $self->getConstants(); $prefix = strtoupper($name) . '_'; $prefixLength = strlen($prefix...
php
public static function getConstants($name) { if (isset(self::$_const[$name])) { return self::$_const[$name]; } $self = new \ReflectionClass(new static()); $contants = $self->getConstants(); $prefix = strtoupper($name) . '_'; $prefixLength = strlen($prefix...
[ "public", "static", "function", "getConstants", "(", "$", "name", ")", "{", "if", "(", "isset", "(", "self", "::", "$", "_const", "[", "$", "name", "]", ")", ")", "{", "return", "self", "::", "$", "_const", "[", "$", "name", "]", ";", "}", "$", ...
get constants by name @param string $name @return array
[ "get", "constants", "by", "name" ]
80758d1519162d650ca2d41e00f46e760ee35b92
https://github.com/Rockbeat-Sky/yii/blob/80758d1519162d650ca2d41e00f46e760ee35b92/src/db/ActiveRecord.php#L72-L89
200,815
anime-db/catalog-bundle
src/Controller/FillController.php
FillController.fillerAction
public function fillerAction($plugin, Request $request) { /* @var $response Response */ $response = $this->getCacheTimeKeeper()->getResponse(); // response was not modified for this request if ($response->isNotModified($request)) { return $response; } /* ...
php
public function fillerAction($plugin, Request $request) { /* @var $response Response */ $response = $this->getCacheTimeKeeper()->getResponse(); // response was not modified for this request if ($response->isNotModified($request)) { return $response; } /* ...
[ "public", "function", "fillerAction", "(", "$", "plugin", ",", "Request", "$", "request", ")", "{", "/* @var $response Response */", "$", "response", "=", "$", "this", "->", "getCacheTimeKeeper", "(", ")", "->", "getResponse", "(", ")", ";", "// response was not...
Create new item from source fill. @param string $plugin @param Request $request @return Response
[ "Create", "new", "item", "from", "source", "fill", "." ]
631b6f92a654e91bee84f46218c52cf42bdb8606
https://github.com/anime-db/catalog-bundle/blob/631b6f92a654e91bee84f46218c52cf42bdb8606/src/Controller/FillController.php#L42-L78
200,816
anime-db/catalog-bundle
src/Controller/FillController.php
FillController.searchFillerAction
public function searchFillerAction(Request $request) { /* @var $chain ChainFiller */ $chain = $this->get('anime_db.plugin.filler'); $response = $this->getResponseFromChain($chain); // response was not modified for this request if ($response->isNotModified($request)) { ...
php
public function searchFillerAction(Request $request) { /* @var $chain ChainFiller */ $chain = $this->get('anime_db.plugin.filler'); $response = $this->getResponseFromChain($chain); // response was not modified for this request if ($response->isNotModified($request)) { ...
[ "public", "function", "searchFillerAction", "(", "Request", "$", "request", ")", "{", "/* @var $chain ChainFiller */", "$", "chain", "=", "$", "this", "->", "get", "(", "'anime_db.plugin.filler'", ")", ";", "$", "response", "=", "$", "this", "->", "getResponseFr...
Search filler by URL for fill item. @param Request $request @return Response
[ "Search", "filler", "by", "URL", "for", "fill", "item", "." ]
631b6f92a654e91bee84f46218c52cf42bdb8606
https://github.com/anime-db/catalog-bundle/blob/631b6f92a654e91bee84f46218c52cf42bdb8606/src/Controller/FillController.php#L160-L181
200,817
anime-db/catalog-bundle
src/Controller/FillController.php
FillController.getResponseFromChain
protected function getResponseFromChain(Chain $chain) { if (!$chain->getPlugins()) { throw $this->createNotFoundException('No any plugins'); } $names = ''; /* @var $plugin PluginInterface */ foreach ($chain->getPlugins() as $plugin) { $names .= '|'.$p...
php
protected function getResponseFromChain(Chain $chain) { if (!$chain->getPlugins()) { throw $this->createNotFoundException('No any plugins'); } $names = ''; /* @var $plugin PluginInterface */ foreach ($chain->getPlugins() as $plugin) { $names .= '|'.$p...
[ "protected", "function", "getResponseFromChain", "(", "Chain", "$", "chain", ")", "{", "if", "(", "!", "$", "chain", "->", "getPlugins", "(", ")", ")", "{", "throw", "$", "this", "->", "createNotFoundException", "(", "'No any plugins'", ")", ";", "}", "$",...
Get response from plugins chain. @param Chain $chain @return Response
[ "Get", "response", "from", "plugins", "chain", "." ]
631b6f92a654e91bee84f46218c52cf42bdb8606
https://github.com/anime-db/catalog-bundle/blob/631b6f92a654e91bee84f46218c52cf42bdb8606/src/Controller/FillController.php#L190-L206
200,818
zarathustra323/modlr-data
src/Zarathustra/ModlrData/Metadata/Cache/RedisCache.php
RedisCache.serialize
private function serialize(EntityMetadata $metadata) { switch ($this->serializer) { case self::SERIALIZER_PHP: return serialize($metadata); case self::SERIALIZER_IGBINARY: return igbinary_serialize($metadata); default: throw...
php
private function serialize(EntityMetadata $metadata) { switch ($this->serializer) { case self::SERIALIZER_PHP: return serialize($metadata); case self::SERIALIZER_IGBINARY: return igbinary_serialize($metadata); default: throw...
[ "private", "function", "serialize", "(", "EntityMetadata", "$", "metadata", ")", "{", "switch", "(", "$", "this", "->", "serializer", ")", "{", "case", "self", "::", "SERIALIZER_PHP", ":", "return", "serialize", "(", "$", "metadata", ")", ";", "case", "sel...
Serializes the metadata object based on the selected serializer. @param EntityMetadata $metadata @return string @throws RuntimeException
[ "Serializes", "the", "metadata", "object", "based", "on", "the", "selected", "serializer", "." ]
7c2c767216055f75abf8cf22e2200f11998ed24e
https://github.com/zarathustra323/modlr-data/blob/7c2c767216055f75abf8cf22e2200f11998ed24e/src/Zarathustra/ModlrData/Metadata/Cache/RedisCache.php#L115-L125
200,819
zarathustra323/modlr-data
src/Zarathustra/ModlrData/Metadata/Cache/RedisCache.php
RedisCache.unserialize
private function unserialize($value) { switch ($this->serializer) { case self::SERIALIZER_PHP: return unserialize($value); case self::SERIALIZER_IGBINARY: return igbinary_unserialize($value); default: throw new RuntimeExcept...
php
private function unserialize($value) { switch ($this->serializer) { case self::SERIALIZER_PHP: return unserialize($value); case self::SERIALIZER_IGBINARY: return igbinary_unserialize($value); default: throw new RuntimeExcept...
[ "private", "function", "unserialize", "(", "$", "value", ")", "{", "switch", "(", "$", "this", "->", "serializer", ")", "{", "case", "self", "::", "SERIALIZER_PHP", ":", "return", "unserialize", "(", "$", "value", ")", ";", "case", "self", "::", "SERIALI...
Unserializes the metadata object based on the selected serializer. @param string $value @return string @throws RuntimeException
[ "Unserializes", "the", "metadata", "object", "based", "on", "the", "selected", "serializer", "." ]
7c2c767216055f75abf8cf22e2200f11998ed24e
https://github.com/zarathustra323/modlr-data/blob/7c2c767216055f75abf8cf22e2200f11998ed24e/src/Zarathustra/ModlrData/Metadata/Cache/RedisCache.php#L134-L144
200,820
jbouzekri/SculpinTagCloudBundle
Component/Strategy/PercentSizeStrategy.php
PercentSizeStrategy.setPercentSize
private function setPercentSize(\Jb\Bundle\TagCloudBundle\Model\Tag $tag, $max) { $percent = ($tag->getCounter() / $max) * 100; $weight = floor($percent / 10); if ($percent >= 5) { $weight++; } if ($percent >= 80 && $percent < 100) { $weight = 8; ...
php
private function setPercentSize(\Jb\Bundle\TagCloudBundle\Model\Tag $tag, $max) { $percent = ($tag->getCounter() / $max) * 100; $weight = floor($percent / 10); if ($percent >= 5) { $weight++; } if ($percent >= 80 && $percent < 100) { $weight = 8; ...
[ "private", "function", "setPercentSize", "(", "\\", "Jb", "\\", "Bundle", "\\", "TagCloudBundle", "\\", "Model", "\\", "Tag", "$", "tag", ",", "$", "max", ")", "{", "$", "percent", "=", "(", "$", "tag", "->", "getCounter", "(", ")", "/", "$", "max", ...
Set a size @param \Jb\Bundle\TagCloudBundle\Model\Tag $tag @param type $max
[ "Set", "a", "size" ]
936cf34ce60cb8fb4774931b1841fc775a3e9208
https://github.com/jbouzekri/SculpinTagCloudBundle/blob/936cf34ce60cb8fb4774931b1841fc775a3e9208/Component/Strategy/PercentSizeStrategy.php#L29-L46
200,821
cloudtek/dynamodm
lib/Cloudtek/DynamoDM/Utility/LifecycleEventManager.php
LifecycleEventManager.documentNotFound
public function documentNotFound($proxy, Identifier $identifier) { $eventArgs = new DocumentNotFoundEventArgs($proxy, $this->dm, $identifier); $this->evm->dispatchEvent(Event::documentNotFound, $eventArgs); return $eventArgs->isExceptionDisabled(); }
php
public function documentNotFound($proxy, Identifier $identifier) { $eventArgs = new DocumentNotFoundEventArgs($proxy, $this->dm, $identifier); $this->evm->dispatchEvent(Event::documentNotFound, $eventArgs); return $eventArgs->isExceptionDisabled(); }
[ "public", "function", "documentNotFound", "(", "$", "proxy", ",", "Identifier", "$", "identifier", ")", "{", "$", "eventArgs", "=", "new", "DocumentNotFoundEventArgs", "(", "$", "proxy", ",", "$", "this", "->", "dm", ",", "$", "identifier", ")", ";", "$", ...
Return whether the exceptionDisabled flag was set. @param object $proxy @param Identifier $identifier @return bool
[ "Return", "whether", "the", "exceptionDisabled", "flag", "was", "set", "." ]
119d355e2c5cbaef1f867970349b4432f5704fcd
https://github.com/cloudtek/dynamodm/blob/119d355e2c5cbaef1f867970349b4432f5704fcd/lib/Cloudtek/DynamoDM/Utility/LifecycleEventManager.php#L130-L136
200,822
LPLabs/wordpress-muplugin-installer
src/Installer/WordPressMustUsePluginInstaller.php
WordPressMustUsePluginInstaller.installEntryFiles
protected function installEntryFiles(PackageInterface $package) { foreach ($this->getEntryFileLocations($package) as $src => $dest) { $copied = $this->filesystem->copyFile($src, $dest); $this->io->notice( sprintf( ' <fg=default>Copying <fg=mage...
php
protected function installEntryFiles(PackageInterface $package) { foreach ($this->getEntryFileLocations($package) as $src => $dest) { $copied = $this->filesystem->copyFile($src, $dest); $this->io->notice( sprintf( ' <fg=default>Copying <fg=mage...
[ "protected", "function", "installEntryFiles", "(", "PackageInterface", "$", "package", ")", "{", "foreach", "(", "$", "this", "->", "getEntryFileLocations", "(", "$", "package", ")", "as", "$", "src", "=>", "$", "dest", ")", "{", "$", "copied", "=", "$", ...
Install each must-use plugin entry file @param PackageInterface $package @return void
[ "Install", "each", "must", "-", "use", "plugin", "entry", "file" ]
c216c1ecd60a2cf47839f804d7591b7db2fd0db1
https://github.com/LPLabs/wordpress-muplugin-installer/blob/c216c1ecd60a2cf47839f804d7591b7db2fd0db1/src/Installer/WordPressMustUsePluginInstaller.php#L85-L103
200,823
LPLabs/wordpress-muplugin-installer
src/Installer/WordPressMustUsePluginInstaller.php
WordPressMustUsePluginInstaller.uninstallEntryFiles
protected function uninstallEntryFiles(PackageInterface $package) { foreach ($this->getEntryFileLocations($package) as $dest) { $unlinked = $this->filesystem->unlinkFile($dest); $this->io->notice( sprintf( ' <fg=default>Removing <fg=magenta>%1$...
php
protected function uninstallEntryFiles(PackageInterface $package) { foreach ($this->getEntryFileLocations($package) as $dest) { $unlinked = $this->filesystem->unlinkFile($dest); $this->io->notice( sprintf( ' <fg=default>Removing <fg=magenta>%1$...
[ "protected", "function", "uninstallEntryFiles", "(", "PackageInterface", "$", "package", ")", "{", "foreach", "(", "$", "this", "->", "getEntryFileLocations", "(", "$", "package", ")", "as", "$", "dest", ")", "{", "$", "unlinked", "=", "$", "this", "->", "...
Uninstall each must-use plugin entry file @param PackageInterface $package @return void
[ "Uninstall", "each", "must", "-", "use", "plugin", "entry", "file" ]
c216c1ecd60a2cf47839f804d7591b7db2fd0db1
https://github.com/LPLabs/wordpress-muplugin-installer/blob/c216c1ecd60a2cf47839f804d7591b7db2fd0db1/src/Installer/WordPressMustUsePluginInstaller.php#L111-L128
200,824
LPLabs/wordpress-muplugin-installer
src/Installer/WordPressMustUsePluginInstaller.php
WordPressMustUsePluginInstaller.getPackageExtra
protected function getPackageExtra(PackageInterface $package, $key, $default = null) { $extra = $package->getExtra(); return array_key_exists($key, $extra) ? $extra[ $key ] : $default; }
php
protected function getPackageExtra(PackageInterface $package, $key, $default = null) { $extra = $package->getExtra(); return array_key_exists($key, $extra) ? $extra[ $key ] : $default; }
[ "protected", "function", "getPackageExtra", "(", "PackageInterface", "$", "package", ",", "$", "key", ",", "$", "default", "=", "null", ")", "{", "$", "extra", "=", "$", "package", "->", "getExtra", "(", ")", ";", "return", "array_key_exists", "(", "$", ...
Get an item from the package extra array @param PackageInterface $package @param string $key @param mixed $default @return mixed
[ "Get", "an", "item", "from", "the", "package", "extra", "array" ]
c216c1ecd60a2cf47839f804d7591b7db2fd0db1
https://github.com/LPLabs/wordpress-muplugin-installer/blob/c216c1ecd60a2cf47839f804d7591b7db2fd0db1/src/Installer/WordPressMustUsePluginInstaller.php#L138-L143
200,825
LPLabs/wordpress-muplugin-installer
src/Installer/WordPressMustUsePluginInstaller.php
WordPressMustUsePluginInstaller.getPackageEntryPoints
protected function getPackageEntryPoints(PackageInterface $package) { $dir = $this->composer->getInstallationManager()->getInstallPath($package); $entry = $this->getPackageExtra($package, 'wordpress-muplugin-entry'); $entryPoints = $entry ? (is_array($entry) ? $entry : [ $entry ]) : []; ...
php
protected function getPackageEntryPoints(PackageInterface $package) { $dir = $this->composer->getInstallationManager()->getInstallPath($package); $entry = $this->getPackageExtra($package, 'wordpress-muplugin-entry'); $entryPoints = $entry ? (is_array($entry) ? $entry : [ $entry ]) : []; ...
[ "protected", "function", "getPackageEntryPoints", "(", "PackageInterface", "$", "package", ")", "{", "$", "dir", "=", "$", "this", "->", "composer", "->", "getInstallationManager", "(", ")", "->", "getInstallPath", "(", "$", "package", ")", ";", "$", "entry", ...
Get the package entry points @param PackageInterface $package @return array
[ "Get", "the", "package", "entry", "points" ]
c216c1ecd60a2cf47839f804d7591b7db2fd0db1
https://github.com/LPLabs/wordpress-muplugin-installer/blob/c216c1ecd60a2cf47839f804d7591b7db2fd0db1/src/Installer/WordPressMustUsePluginInstaller.php#L172-L191
200,826
LPLabs/wordpress-muplugin-installer
src/Installer/WordPressMustUsePluginInstaller.php
WordPressMustUsePluginInstaller.looksLikePlugin
protected function looksLikePlugin($file) { if (! $file || ! $this->filesystem->isFile($file) || ! $this->filesystem->isReadable($file)) { return false; } $chunk = str_replace("\r", "\n", file_get_contents($file, false, null, 0, 8192)); return preg_match('/^[ \t\/*#@]*P...
php
protected function looksLikePlugin($file) { if (! $file || ! $this->filesystem->isFile($file) || ! $this->filesystem->isReadable($file)) { return false; } $chunk = str_replace("\r", "\n", file_get_contents($file, false, null, 0, 8192)); return preg_match('/^[ \t\/*#@]*P...
[ "protected", "function", "looksLikePlugin", "(", "$", "file", ")", "{", "if", "(", "!", "$", "file", "||", "!", "$", "this", "->", "filesystem", "->", "isFile", "(", "$", "file", ")", "||", "!", "$", "this", "->", "filesystem", "->", "isReadable", "(...
Does the file look like a WordPress plugin? @param string $file @return bool
[ "Does", "the", "file", "look", "like", "a", "WordPress", "plugin?" ]
c216c1ecd60a2cf47839f804d7591b7db2fd0db1
https://github.com/LPLabs/wordpress-muplugin-installer/blob/c216c1ecd60a2cf47839f804d7591b7db2fd0db1/src/Installer/WordPressMustUsePluginInstaller.php#L199-L208
200,827
agentmedia/phine-core
src/Core/Logic/Module/BackendModule.php
BackendModule.RenderBlock
public function RenderBlock($block) { $templateFile = $this->BuiltInTemplateFile(); $blockFile = Path::AddExtension($templateFile, $block, true); $blockFileExt = Path::AddExtension($blockFile, 'phtml'); if (!File::Exists($blockFileExt)) { return ''; } ...
php
public function RenderBlock($block) { $templateFile = $this->BuiltInTemplateFile(); $blockFile = Path::AddExtension($templateFile, $block, true); $blockFileExt = Path::AddExtension($blockFile, 'phtml'); if (!File::Exists($blockFileExt)) { return ''; } ...
[ "public", "function", "RenderBlock", "(", "$", "block", ")", "{", "$", "templateFile", "=", "$", "this", "->", "BuiltInTemplateFile", "(", ")", ";", "$", "blockFile", "=", "Path", "::", "AddExtension", "(", "$", "templateFile", ",", "$", "block", ",", "t...
Renders a block by name @param string $block @return string
[ "Renders", "a", "block", "by", "name" ]
38c1be8d03ebffae950d00a96da3c612aff67832
https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Module/BackendModule.php#L39-L51
200,828
wb-crowdfusion/crowdfusion
system/core/classes/libraries/model/Object.php
Object.setFromArray
public function setFromArray(array $fields) { foreach($fields as $key => $value) { $this->fields[$key] = $value; unset($key); unset($value); } }
php
public function setFromArray(array $fields) { foreach($fields as $key => $value) { $this->fields[$key] = $value; unset($key); unset($value); } }
[ "public", "function", "setFromArray", "(", "array", "$", "fields", ")", "{", "foreach", "(", "$", "fields", "as", "$", "key", "=>", "$", "value", ")", "{", "$", "this", "->", "fields", "[", "$", "key", "]", "=", "$", "value", ";", "unset", "(", "...
Sets the fields on the object. @param array $fields array of fields returned from SQL select result set @return void
[ "Sets", "the", "fields", "on", "the", "object", "." ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/model/Object.php#L57-L65
200,829
devlabmtl/haven-cms
Lib/Handler/CommentFormHandler.php
CommentFormHandler.createAddCommentForm
public function createAddCommentForm(Content $content, $user = null) { $comment = new Comment(); $comment->setContent($content); if ($user !== 'anon.') { $comment->setEmail($user->getEmail()); } $form = $this->form_factory->create(new CommentType(), $comment); ...
php
public function createAddCommentForm(Content $content, $user = null) { $comment = new Comment(); $comment->setContent($content); if ($user !== 'anon.') { $comment->setEmail($user->getEmail()); } $form = $this->form_factory->create(new CommentType(), $comment); ...
[ "public", "function", "createAddCommentForm", "(", "Content", "$", "content", ",", "$", "user", "=", "null", ")", "{", "$", "comment", "=", "new", "Comment", "(", ")", ";", "$", "comment", "->", "setContent", "(", "$", "content", ")", ";", "if", "(", ...
Creates a form to comment on a content. @param Haven\CmsBundle\Entity\Content $content @return Haven\CmsBundle\Form\CommentType $form
[ "Creates", "a", "form", "to", "comment", "on", "a", "content", "." ]
c20761a07c201a966dbda1f3eae33617f80e1ece
https://github.com/devlabmtl/haven-cms/blob/c20761a07c201a966dbda1f3eae33617f80e1ece/Lib/Handler/CommentFormHandler.php#L63-L72
200,830
romm/configuration_object
Classes/Service/Items/Parents/ParentsTrait.php
ParentsTrait.attachParents
public function attachParents(array $parents) { $this->_parents = []; foreach ($parents as $parent) { $this->attachParent($parent, false); } }
php
public function attachParents(array $parents) { $this->_parents = []; foreach ($parents as $parent) { $this->attachParent($parent, false); } }
[ "public", "function", "attachParents", "(", "array", "$", "parents", ")", "{", "$", "this", "->", "_parents", "=", "[", "]", ";", "foreach", "(", "$", "parents", "as", "$", "parent", ")", "{", "$", "this", "->", "attachParent", "(", "$", "parent", ",...
Loops on each given parent and attach it to this object. The order matters: the first item will be added as a direct parent whereas the last one will be the remote parent. Note that this function will also reset @param object[] $parents
[ "Loops", "on", "each", "given", "parent", "and", "attach", "it", "to", "this", "object", "." ]
d3a40903386c2e0766bd8279337fe6da45cf5ce3
https://github.com/romm/configuration_object/blob/d3a40903386c2e0766bd8279337fe6da45cf5ce3/Classes/Service/Items/Parents/ParentsTrait.php#L94-L101
200,831
romm/configuration_object
Classes/Service/Items/Parents/ParentsTrait.php
ParentsTrait.hasParent
public function hasParent($parentClassName) { $found = false; $this->alongParents(function ($parent) use ($parentClassName, &$found) { if ($parent instanceof $parentClassName) { $found = true; return false; } return true; ...
php
public function hasParent($parentClassName) { $found = false; $this->alongParents(function ($parent) use ($parentClassName, &$found) { if ($parent instanceof $parentClassName) { $found = true; return false; } return true; ...
[ "public", "function", "hasParent", "(", "$", "parentClassName", ")", "{", "$", "found", "=", "false", ";", "$", "this", "->", "alongParents", "(", "function", "(", "$", "parent", ")", "use", "(", "$", "parentClassName", ",", "&", "$", "found", ")", "{"...
Returns true if the class has a given parent. @param string $parentClassName Name of the parent class. @return bool
[ "Returns", "true", "if", "the", "class", "has", "a", "given", "parent", "." ]
d3a40903386c2e0766bd8279337fe6da45cf5ce3
https://github.com/romm/configuration_object/blob/d3a40903386c2e0766bd8279337fe6da45cf5ce3/Classes/Service/Items/Parents/ParentsTrait.php#L123-L138
200,832
romm/configuration_object
Classes/Service/Items/Parents/ParentsTrait.php
ParentsTrait.withFirstParent
public function withFirstParent($parentClassName, callable $callback, callable $notFoundCallback = null) { $result = null; if ($this->hasParent($parentClassName)) { $parent = $this->getFirstParent($parentClassName); $result = call_user_func($callback, $parent); } els...
php
public function withFirstParent($parentClassName, callable $callback, callable $notFoundCallback = null) { $result = null; if ($this->hasParent($parentClassName)) { $parent = $this->getFirstParent($parentClassName); $result = call_user_func($callback, $parent); } els...
[ "public", "function", "withFirstParent", "(", "$", "parentClassName", ",", "callable", "$", "callback", ",", "callable", "$", "notFoundCallback", "=", "null", ")", "{", "$", "result", "=", "null", ";", "if", "(", "$", "this", "->", "hasParent", "(", "$", ...
Will fetch the first parent which matches the given class name. If a parent is found, then `$callback` is called, and its returned value is returned by this function. If no parent is found, then `$notFoundCallBack` is called if it was defined. @param string $parentClassName Name of the class name of the wanted pa...
[ "Will", "fetch", "the", "first", "parent", "which", "matches", "the", "given", "class", "name", "." ]
d3a40903386c2e0766bd8279337fe6da45cf5ce3
https://github.com/romm/configuration_object/blob/d3a40903386c2e0766bd8279337fe6da45cf5ce3/Classes/Service/Items/Parents/ParentsTrait.php#L154-L166
200,833
romm/configuration_object
Classes/Service/Items/Parents/ParentsTrait.php
ParentsTrait.getFirstParent
public function getFirstParent($parentClassName) { $foundParent = null; $this->alongParents(function ($parent) use ($parentClassName, &$foundParent) { if ($parent instanceof $parentClassName) { $foundParent = $parent; return false; } ...
php
public function getFirstParent($parentClassName) { $foundParent = null; $this->alongParents(function ($parent) use ($parentClassName, &$foundParent) { if ($parent instanceof $parentClassName) { $foundParent = $parent; return false; } ...
[ "public", "function", "getFirstParent", "(", "$", "parentClassName", ")", "{", "$", "foundParent", "=", "null", ";", "$", "this", "->", "alongParents", "(", "function", "(", "$", "parent", ")", "use", "(", "$", "parentClassName", ",", "&", "$", "foundParen...
Returns the first found instance of the desired parent. An exception is thrown if the parent is not found. It is advised to use the function `hasParent()` before using this function. @param string $parentClassName Name of the parent class. @return object @throws EntryNotFoundException
[ "Returns", "the", "first", "found", "instance", "of", "the", "desired", "parent", "." ]
d3a40903386c2e0766bd8279337fe6da45cf5ce3
https://github.com/romm/configuration_object/blob/d3a40903386c2e0766bd8279337fe6da45cf5ce3/Classes/Service/Items/Parents/ParentsTrait.php#L178-L200
200,834
zewadesign/framework
Zewa/View.php
View.setView
public function setView($viewName) { $view = $this->pathToView . DIRECTORY_SEPARATOR . strtolower($viewName) . '.php'; if (!file_exists($view)) { throw new Exception\LookupException('View: "' . $view . '" could not be found.'); } $this->viewQueue[$viewName] = $view; ...
php
public function setView($viewName) { $view = $this->pathToView . DIRECTORY_SEPARATOR . strtolower($viewName) . '.php'; if (!file_exists($view)) { throw new Exception\LookupException('View: "' . $view . '" could not be found.'); } $this->viewQueue[$viewName] = $view; ...
[ "public", "function", "setView", "(", "$", "viewName", ")", "{", "$", "view", "=", "$", "this", "->", "pathToView", ".", "DIRECTORY_SEPARATOR", ".", "strtolower", "(", "$", "viewName", ")", ".", "'.php'", ";", "if", "(", "!", "file_exists", "(", "$", "...
formats and prepares view for inclusion @param $viewName @return string @throws Exception\LookupException
[ "formats", "and", "prepares", "view", "for", "inclusion" ]
be74e41c674ac2c2ef924752ed310cfbaafe33b8
https://github.com/zewadesign/framework/blob/be74e41c674ac2c2ef924752ed310cfbaafe33b8/Zewa/View.php#L125-L134
200,835
zewadesign/framework
Zewa/View.php
View.fetchCSS
public function fetchCSS() { $string = ""; if (empty($this->queuedCSS)) { return $string; } foreach ($this->queuedCSS as $sheet) { $string .= '<link rel="stylesheet" href="' . $sheet .'">' . "\r\n"; } return $string; }
php
public function fetchCSS() { $string = ""; if (empty($this->queuedCSS)) { return $string; } foreach ($this->queuedCSS as $sheet) { $string .= '<link rel="stylesheet" href="' . $sheet .'">' . "\r\n"; } return $string; }
[ "public", "function", "fetchCSS", "(", ")", "{", "$", "string", "=", "\"\"", ";", "if", "(", "empty", "(", "$", "this", "->", "queuedCSS", ")", ")", "{", "return", "$", "string", ";", "}", "foreach", "(", "$", "this", "->", "queuedCSS", "as", "$", ...
Helper method for grabbing aggregated css files @access protected @return string css includes
[ "Helper", "method", "for", "grabbing", "aggregated", "css", "files" ]
be74e41c674ac2c2ef924752ed310cfbaafe33b8
https://github.com/zewadesign/framework/blob/be74e41c674ac2c2ef924752ed310cfbaafe33b8/Zewa/View.php#L249-L262
200,836
zewadesign/framework
Zewa/View.php
View.fetchJS
public function fetchJS() { $string = "<script>baseURL = '" . $this->router->baseURL() . "/'</script>\r\n"; if (empty($this->queuedJS)) { return $string; } foreach ($this->queuedJS as $script) { $string .= '<script src="' . $script . '"></script>' . "\r\n"; ...
php
public function fetchJS() { $string = "<script>baseURL = '" . $this->router->baseURL() . "/'</script>\r\n"; if (empty($this->queuedJS)) { return $string; } foreach ($this->queuedJS as $script) { $string .= '<script src="' . $script . '"></script>' . "\r\n"; ...
[ "public", "function", "fetchJS", "(", ")", "{", "$", "string", "=", "\"<script>baseURL = '\"", ".", "$", "this", "->", "router", "->", "baseURL", "(", ")", ".", "\"/'</script>\\r\\n\"", ";", "if", "(", "empty", "(", "$", "this", "->", "queuedJS", ")", ")...
Helper method for grabbing aggregated JS files @access protected @return string JS includes
[ "Helper", "method", "for", "grabbing", "aggregated", "JS", "files" ]
be74e41c674ac2c2ef924752ed310cfbaafe33b8
https://github.com/zewadesign/framework/blob/be74e41c674ac2c2ef924752ed310cfbaafe33b8/Zewa/View.php#L270-L283
200,837
phpguard/listen
src/PhpGuard/Listen/Resource/FileResource.php
FileResource.isExists
public function isExists() { clearstatcache(true,(string)$this->resource); return is_file((string)$this->resource); }
php
public function isExists() { clearstatcache(true,(string)$this->resource); return is_file((string)$this->resource); }
[ "public", "function", "isExists", "(", ")", "{", "clearstatcache", "(", "true", ",", "(", "string", ")", "$", "this", "->", "resource", ")", ";", "return", "is_file", "(", "(", "string", ")", "$", "this", "->", "resource", ")", ";", "}" ]
Returns true if the resource exists in the filesystem. @return Boolean
[ "Returns", "true", "if", "the", "resource", "exists", "in", "the", "filesystem", "." ]
cd0cda150858d6d85deb025a72996873d2af3532
https://github.com/phpguard/listen/blob/cd0cda150858d6d85deb025a72996873d2af3532/src/PhpGuard/Listen/Resource/FileResource.php#L52-L56
200,838
Mandarin-Medien/MMCmfContentBundle
Controller/ContentNodeController.php
ContentNodeController.saveAction
public function saveAction(Request $request) { $json_nodes = $request->get('nodes'); if ($json_nodes) { $this->em = $this->getDoctrine()->getManager(); foreach ($json_nodes as $id => $obj) { $contentNode = $this->em->find(ContentNode::class, $id); ...
php
public function saveAction(Request $request) { $json_nodes = $request->get('nodes'); if ($json_nodes) { $this->em = $this->getDoctrine()->getManager(); foreach ($json_nodes as $id => $obj) { $contentNode = $this->em->find(ContentNode::class, $id); ...
[ "public", "function", "saveAction", "(", "Request", "$", "request", ")", "{", "$", "json_nodes", "=", "$", "request", "->", "get", "(", "'nodes'", ")", ";", "if", "(", "$", "json_nodes", ")", "{", "$", "this", "->", "em", "=", "$", "this", "->", "g...
AJAX save endpoint, not related to the CRUD @param Request $request @return JsonResponse
[ "AJAX", "save", "endpoint", "not", "related", "to", "the", "CRUD" ]
503ab31cef3ce068f767de5b72f833526355b726
https://github.com/Mandarin-Medien/MMCmfContentBundle/blob/503ab31cef3ce068f767de5b72f833526355b726/Controller/ContentNodeController.php#L35-L96
200,839
Mandarin-Medien/MMCmfContentBundle
Controller/ContentNodeController.php
ContentNodeController.simpleUpdateAction
public function simpleUpdateAction(Request $request, ContentNode $contentNode) { return $this->updateAction($request, $contentNode, true); }
php
public function simpleUpdateAction(Request $request, ContentNode $contentNode) { return $this->updateAction($request, $contentNode, true); }
[ "public", "function", "simpleUpdateAction", "(", "Request", "$", "request", ",", "ContentNode", "$", "contentNode", ")", "{", "return", "$", "this", "->", "updateAction", "(", "$", "request", ",", "$", "contentNode", ",", "true", ")", ";", "}" ]
validates the simple ContentNode Form @param Request $request @param ContentNode $contentNode @return JsonResponse
[ "validates", "the", "simple", "ContentNode", "Form" ]
503ab31cef3ce068f767de5b72f833526355b726
https://github.com/Mandarin-Medien/MMCmfContentBundle/blob/503ab31cef3ce068f767de5b72f833526355b726/Controller/ContentNodeController.php#L191-L194
200,840
Mandarin-Medien/MMCmfContentBundle
Controller/ContentNodeController.php
ContentNodeController.updateAction
public function updateAction(Request $request, ContentNode $contentNode, $isSimpleForm = false) { $em = $this->getDoctrine()->getManager(); $repository = $this->getDoctrine()->getRepository('MMCmfNodeBundle:Node'); $rootNode = null; if ((int)$request->get('root_node')) { ...
php
public function updateAction(Request $request, ContentNode $contentNode, $isSimpleForm = false) { $em = $this->getDoctrine()->getManager(); $repository = $this->getDoctrine()->getRepository('MMCmfNodeBundle:Node'); $rootNode = null; if ((int)$request->get('root_node')) { ...
[ "public", "function", "updateAction", "(", "Request", "$", "request", ",", "ContentNode", "$", "contentNode", ",", "$", "isSimpleForm", "=", "false", ")", "{", "$", "em", "=", "$", "this", "->", "getDoctrine", "(", ")", "->", "getManager", "(", ")", ";",...
validates the general ContentNode Form @param Request $request @param ContentNode $contentNode @param bool $isSimpleForm @return JsonResponse
[ "validates", "the", "general", "ContentNode", "Form" ]
503ab31cef3ce068f767de5b72f833526355b726
https://github.com/Mandarin-Medien/MMCmfContentBundle/blob/503ab31cef3ce068f767de5b72f833526355b726/Controller/ContentNodeController.php#L362-L398
200,841
Mandarin-Medien/MMCmfContentBundle
Controller/ContentNodeController.php
ContentNodeController.createSimpleEditForm
public function createSimpleEditForm(ContentNode $contentNode, Node $rootNode = null) { $contentNodeClassName = get_class($contentNode); $contentNodeParser = $this->get('mm_cmf_content.content_parser'); $simpleFormData = $contentNodeParser->getSimpleForm($contentNodeClassName); //s...
php
public function createSimpleEditForm(ContentNode $contentNode, Node $rootNode = null) { $contentNodeClassName = get_class($contentNode); $contentNodeParser = $this->get('mm_cmf_content.content_parser'); $simpleFormData = $contentNodeParser->getSimpleForm($contentNodeClassName); //s...
[ "public", "function", "createSimpleEditForm", "(", "ContentNode", "$", "contentNode", ",", "Node", "$", "rootNode", "=", "null", ")", "{", "$", "contentNodeClassName", "=", "get_class", "(", "$", "contentNode", ")", ";", "$", "contentNodeParser", "=", "$", "th...
Returns the configured Simple Form for Frontend Editing purpose @param ContentNode $contentNode @param Node|null $rootNode @return \Symfony\Component\Form\Form
[ "Returns", "the", "configured", "Simple", "Form", "for", "Frontend", "Editing", "purpose" ]
503ab31cef3ce068f767de5b72f833526355b726
https://github.com/Mandarin-Medien/MMCmfContentBundle/blob/503ab31cef3ce068f767de5b72f833526355b726/Controller/ContentNodeController.php#L407-L439
200,842
LpFactory/NestedSetRoutingBundle
Factory/PageRouteFactory.php
PageRouteFactory.createFromId
public function createFromId(AbstractPageRouteConfiguration $routeConfiguration, $pageId) { $page = $this->repository->find($pageId); return $this->create($routeConfiguration, $page); }
php
public function createFromId(AbstractPageRouteConfiguration $routeConfiguration, $pageId) { $page = $this->repository->find($pageId); return $this->create($routeConfiguration, $page); }
[ "public", "function", "createFromId", "(", "AbstractPageRouteConfiguration", "$", "routeConfiguration", ",", "$", "pageId", ")", "{", "$", "page", "=", "$", "this", "->", "repository", "->", "find", "(", "$", "pageId", ")", ";", "return", "$", "this", "->", ...
Create a new route instance from a page id @param AbstractPageRouteConfiguration $routeConfiguration @param int $pageId @return \Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Orm\Route
[ "Create", "a", "new", "route", "instance", "from", "a", "page", "id" ]
dc07227a6764e657b7b321827a18127ec18ba214
https://github.com/LpFactory/NestedSetRoutingBundle/blob/dc07227a6764e657b7b321827a18127ec18ba214/Factory/PageRouteFactory.php#L80-L85
200,843
LpFactory/NestedSetRoutingBundle
Factory/PageRouteFactory.php
PageRouteFactory.buildUrlFromPath
protected function buildUrlFromPath(array $path) { // Remove root level (homepage) array_shift($path); // Homepage if (count($path) === 0 && $this->treeStrategy->isHomeTreeRoot()) { return '/'; } // Build uri from tree path return array_reduce($p...
php
protected function buildUrlFromPath(array $path) { // Remove root level (homepage) array_shift($path); // Homepage if (count($path) === 0 && $this->treeStrategy->isHomeTreeRoot()) { return '/'; } // Build uri from tree path return array_reduce($p...
[ "protected", "function", "buildUrlFromPath", "(", "array", "$", "path", ")", "{", "// Remove root level (homepage)", "array_shift", "(", "$", "path", ")", ";", "// Homepage", "if", "(", "count", "(", "$", "path", ")", "===", "0", "&&", "$", "this", "->", "...
Build an url from a path @param array $path @return string
[ "Build", "an", "url", "from", "a", "path" ]
dc07227a6764e657b7b321827a18127ec18ba214
https://github.com/LpFactory/NestedSetRoutingBundle/blob/dc07227a6764e657b7b321827a18127ec18ba214/Factory/PageRouteFactory.php#L94-L109
200,844
intrip/laravel-library
src/Jacopo/Library/Form/FormModel.php
FormModel.process
public function process(array $input) { if($this->v->validate($input)) { Event::fire("form.processing", array($input)); return $this->callRepository($input); } else { $this->errors = $this->v->getErrors(); throw new ValidationEx...
php
public function process(array $input) { if($this->v->validate($input)) { Event::fire("form.processing", array($input)); return $this->callRepository($input); } else { $this->errors = $this->v->getErrors(); throw new ValidationEx...
[ "public", "function", "process", "(", "array", "$", "input", ")", "{", "if", "(", "$", "this", "->", "v", "->", "validate", "(", "$", "input", ")", ")", "{", "Event", "::", "fire", "(", "\"form.processing\"", ",", "array", "(", "$", "input", ")", "...
Process the input and calls the repository @param array $input @throws \Jacopo\Library\Exceptions\JacopoExceptionsInterface
[ "Process", "the", "input", "and", "calls", "the", "repository" ]
9ea7d5cd9d84c70893238af6300b24c7dd4b8ca3
https://github.com/intrip/laravel-library/blob/9ea7d5cd9d84c70893238af6300b24c7dd4b8ca3/src/Jacopo/Library/Form/FormModel.php#L51-L63
200,845
intrip/laravel-library
src/Jacopo/Library/Form/FormModel.php
FormModel.isUpdate
protected function isUpdate($input) { return (isset($input[$this->id_field_name]) && ! empty($input[$this->id_field_name]) ); }
php
protected function isUpdate($input) { return (isset($input[$this->id_field_name]) && ! empty($input[$this->id_field_name]) ); }
[ "protected", "function", "isUpdate", "(", "$", "input", ")", "{", "return", "(", "isset", "(", "$", "input", "[", "$", "this", "->", "id_field_name", "]", ")", "&&", "!", "empty", "(", "$", "input", "[", "$", "this", "->", "id_field_name", "]", ")", ...
Check if the operation is update or create @param $input @return booelan $update update=true create=false
[ "Check", "if", "the", "operation", "is", "update", "or", "create" ]
9ea7d5cd9d84c70893238af6300b24c7dd4b8ca3
https://github.com/intrip/laravel-library/blob/9ea7d5cd9d84c70893238af6300b24c7dd4b8ca3/src/Jacopo/Library/Form/FormModel.php#L110-L113
200,846
intrip/laravel-library
src/Jacopo/Library/Form/FormModel.php
FormModel.delete
public function delete(array $input) { if(isset($input[$this->id_field_name]) && ! empty($input[$this->id_field_name])) { try { $this->r->delete($input[$this->id_field_name]); } catch(ModelNotFoundException $e) { ...
php
public function delete(array $input) { if(isset($input[$this->id_field_name]) && ! empty($input[$this->id_field_name])) { try { $this->r->delete($input[$this->id_field_name]); } catch(ModelNotFoundException $e) { ...
[ "public", "function", "delete", "(", "array", "$", "input", ")", "{", "if", "(", "isset", "(", "$", "input", "[", "$", "this", "->", "id_field_name", "]", ")", "&&", "!", "empty", "(", "$", "input", "[", "$", "this", "->", "id_field_name", "]", ")"...
Run delete on the repository @param $input @throws \Jacopo\Library\Exceptions\NotFoundException @todo test with exceptions
[ "Run", "delete", "on", "the", "repository" ]
9ea7d5cd9d84c70893238af6300b24c7dd4b8ca3
https://github.com/intrip/laravel-library/blob/9ea7d5cd9d84c70893238af6300b24c7dd4b8ca3/src/Jacopo/Library/Form/FormModel.php#L121-L145
200,847
bseddon/XPath20
AST/ForNode.php
ForNode.getQNVarName
public function getQNVarName() { return \lyquidity\xml\qname( $this->_varName->ToString(), $this->getContext()->NamespaceManager->getNamespaces(), true ); }
php
public function getQNVarName() { return \lyquidity\xml\qname( $this->_varName->ToString(), $this->getContext()->NamespaceManager->getNamespaces(), true ); }
[ "public", "function", "getQNVarName", "(", ")", "{", "return", "\\", "lyquidity", "\\", "xml", "\\", "qname", "(", "$", "this", "->", "_varName", "->", "ToString", "(", ")", ",", "$", "this", "->", "getContext", "(", ")", "->", "NamespaceManager", "->", ...
Get the VarName as a QName
[ "Get", "the", "VarName", "as", "a", "QName" ]
69882b6efffaa5470a819d5fdd2f6473ddeb046d
https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/AST/ForNode.php#L89-L92
200,848
Vectrex/vxPHP
src/Http/JsonResponse.php
JsonResponse.setCallback
public function setCallback($callback = NULL) { if (NULL !== $callback) { // taken from http://www.geekality.net/2011/08/03/valid-javascript-identifier/ $pattern = '/^[$_\p{L}][$_\p{L}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{200C}\x{200D}]*+$/u'; foreach (explode('.', $callback) as $part) { if (!preg_match($pattern...
php
public function setCallback($callback = NULL) { if (NULL !== $callback) { // taken from http://www.geekality.net/2011/08/03/valid-javascript-identifier/ $pattern = '/^[$_\p{L}][$_\p{L}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{200C}\x{200D}]*+$/u'; foreach (explode('.', $callback) as $part) { if (!preg_match($pattern...
[ "public", "function", "setCallback", "(", "$", "callback", "=", "NULL", ")", "{", "if", "(", "NULL", "!==", "$", "callback", ")", "{", "// taken from http://www.geekality.net/2011/08/03/valid-javascript-identifier/", "$", "pattern", "=", "'/^[$_\\p{L}][$_\\p{L}\\p{Mn}\\p{...
set the JSONP callback pass NULL for not using a callback @param string|null $callback @return JsonResponse @throws \InvalidArgumentException when callback name is not valid
[ "set", "the", "JSONP", "callback", "pass", "NULL", "for", "not", "using", "a", "callback" ]
295c21b00e7ef6085efcdf5b64fabb28d499b5a6
https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Http/JsonResponse.php#L72-L90
200,849
Vectrex/vxPHP
src/Http/JsonResponse.php
JsonResponse.setEncodingOptions
public function setEncodingOptions($encodingOptions) { $this->encodingOptions = (int) $encodingOptions; return $this->setPayload(json_decode($this->data)); }
php
public function setEncodingOptions($encodingOptions) { $this->encodingOptions = (int) $encodingOptions; return $this->setPayload(json_decode($this->data)); }
[ "public", "function", "setEncodingOptions", "(", "$", "encodingOptions", ")", "{", "$", "this", "->", "encodingOptions", "=", "(", "int", ")", "$", "encodingOptions", ";", "return", "$", "this", "->", "setPayload", "(", "json_decode", "(", "$", "this", "->",...
set options used while encoding data to JSON re-encodes payload with new encoding setting @param int $encodingOptions @return JsonResponse @throws \Exception
[ "set", "options", "used", "while", "encoding", "data", "to", "JSON", "re", "-", "encodes", "payload", "with", "new", "encoding", "setting" ]
295c21b00e7ef6085efcdf5b64fabb28d499b5a6
https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Http/JsonResponse.php#L144-L150
200,850
Vectrex/vxPHP
src/Http/JsonResponse.php
JsonResponse.update
protected function update() { if(!is_null($this->callback)) { // Not using application/javascript for compatibility reasons with older browsers. $this->headers->set('Content-Type', 'text/javascript'); return $this->setContent(sprintf('/**/%s(%s);', $this->callback, $this->data)); } // se...
php
protected function update() { if(!is_null($this->callback)) { // Not using application/javascript for compatibility reasons with older browsers. $this->headers->set('Content-Type', 'text/javascript'); return $this->setContent(sprintf('/**/%s(%s);', $this->callback, $this->data)); } // se...
[ "protected", "function", "update", "(", ")", "{", "if", "(", "!", "is_null", "(", "$", "this", "->", "callback", ")", ")", "{", "// Not using application/javascript for compatibility reasons with older browsers.", "$", "this", "->", "headers", "->", "set", "(", "'...
update content and headers according to the JSON data and a set callback @return JsonResponse
[ "update", "content", "and", "headers", "according", "to", "the", "JSON", "data", "and", "a", "set", "callback" ]
295c21b00e7ef6085efcdf5b64fabb28d499b5a6
https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Http/JsonResponse.php#L157-L177
200,851
anime-db/catalog-bundle
src/Plugin/Fill/Refiller/Chain.php
Chain.getPluginsThatCanFillItem
public function getPluginsThatCanFillItem(Item $item, $field) { $plugins = []; /* @var $plugin Refiller */ foreach ($this->plugins as $plugin) { if ($plugin->isCanRefill($item, $field) || $plugin->isCanSearch($item, $field)) { $plugins[] = $plugin; } ...
php
public function getPluginsThatCanFillItem(Item $item, $field) { $plugins = []; /* @var $plugin Refiller */ foreach ($this->plugins as $plugin) { if ($plugin->isCanRefill($item, $field) || $plugin->isCanSearch($item, $field)) { $plugins[] = $plugin; } ...
[ "public", "function", "getPluginsThatCanFillItem", "(", "Item", "$", "item", ",", "$", "field", ")", "{", "$", "plugins", "=", "[", "]", ";", "/* @var $plugin Refiller */", "foreach", "(", "$", "this", "->", "plugins", "as", "$", "plugin", ")", "{", "if", ...
Get list of plugins that can fill item. @param Item $item @param string $field @return RefillerInterface[]
[ "Get", "list", "of", "plugins", "that", "can", "fill", "item", "." ]
631b6f92a654e91bee84f46218c52cf42bdb8606
https://github.com/anime-db/catalog-bundle/blob/631b6f92a654e91bee84f46218c52cf42bdb8606/src/Plugin/Fill/Refiller/Chain.php#L30-L41
200,852
iron-bound-designs/IronBound-WPEvents
src/EventDispatcher.php
EventDispatcher.add_listener
public function add_listener( $event_name, $listener, $priority = self::PRIORITY, $accepted_args = self::ACCEPTED ) { if ( ! is_callable( $listener, true ) ) { throw new InvalidListenerException( '$listener must be callable.' ); } if ( ! is_int( $priority ) ) { throw new \InvalidArgumentException( '$prior...
php
public function add_listener( $event_name, $listener, $priority = self::PRIORITY, $accepted_args = self::ACCEPTED ) { if ( ! is_callable( $listener, true ) ) { throw new InvalidListenerException( '$listener must be callable.' ); } if ( ! is_int( $priority ) ) { throw new \InvalidArgumentException( '$prior...
[ "public", "function", "add_listener", "(", "$", "event_name", ",", "$", "listener", ",", "$", "priority", "=", "self", "::", "PRIORITY", ",", "$", "accepted_args", "=", "self", "::", "ACCEPTED", ")", "{", "if", "(", "!", "is_callable", "(", "$", "listene...
Add an event listener that listens for a given event. @since 1.0 @param string $event_name The fully-qualified event name to listen for. @param callable $listener Listener to be called whenever the event occurs. @param int $priority The priority of the listener. Lower priority listeners are called...
[ "Add", "an", "event", "listener", "that", "listens", "for", "a", "given", "event", "." ]
b5bdb570f5377c1a311e572547a8c29d507facf9
https://github.com/iron-bound-designs/IronBound-WPEvents/blob/b5bdb570f5377c1a311e572547a8c29d507facf9/src/EventDispatcher.php#L119-L136
200,853
iron-bound-designs/IronBound-WPEvents
src/EventDispatcher.php
EventDispatcher.remove_listener
public function remove_listener( $event_name, $listener, $priority = self::PRIORITY ) { if ( ! is_callable( $listener, true ) ) { throw new InvalidListenerException( '$listener must be callable.' ); } if ( ! is_int( $priority ) ) { throw new \InvalidArgumentException( '$priority must be an int.' ); } ...
php
public function remove_listener( $event_name, $listener, $priority = self::PRIORITY ) { if ( ! is_callable( $listener, true ) ) { throw new InvalidListenerException( '$listener must be callable.' ); } if ( ! is_int( $priority ) ) { throw new \InvalidArgumentException( '$priority must be an int.' ); } ...
[ "public", "function", "remove_listener", "(", "$", "event_name", ",", "$", "listener", ",", "$", "priority", "=", "self", "::", "PRIORITY", ")", "{", "if", "(", "!", "is_callable", "(", "$", "listener", ",", "true", ")", ")", "{", "throw", "new", "Inva...
Remove an event listener for a given event. @since 1.0 @param string $event_name The fully-qualified event name to remove a listener from. @param callable $listener The listener to be removed. @param int $priority The priority of the listener. @return self
[ "Remove", "an", "event", "listener", "for", "a", "given", "event", "." ]
b5bdb570f5377c1a311e572547a8c29d507facf9
https://github.com/iron-bound-designs/IronBound-WPEvents/blob/b5bdb570f5377c1a311e572547a8c29d507facf9/src/EventDispatcher.php#L149-L162
200,854
iron-bound-designs/IronBound-WPEvents
src/EventDispatcher.php
EventDispatcher.add_subscriber
public function add_subscriber( EventSubscriber $subscriber ) { foreach ( $subscriber->get_subscribed_events() as $event => $params ) { if ( is_string( $params ) ) { $this->add_listener( $event, array( $subscriber, $params ) ); } elseif ( is_array( $params ) && isset( $params[0] ) ) { $method ...
php
public function add_subscriber( EventSubscriber $subscriber ) { foreach ( $subscriber->get_subscribed_events() as $event => $params ) { if ( is_string( $params ) ) { $this->add_listener( $event, array( $subscriber, $params ) ); } elseif ( is_array( $params ) && isset( $params[0] ) ) { $method ...
[ "public", "function", "add_subscriber", "(", "EventSubscriber", "$", "subscriber", ")", "{", "foreach", "(", "$", "subscriber", "->", "get_subscribed_events", "(", ")", "as", "$", "event", "=>", "$", "params", ")", "{", "if", "(", "is_string", "(", "$", "p...
Add an event subscriber. This iterates over all of the subscribers events, and adds them as listeners. @since 1.0 @param EventSubscriber $subscriber @return self
[ "Add", "an", "event", "subscriber", "." ]
b5bdb570f5377c1a311e572547a8c29d507facf9
https://github.com/iron-bound-designs/IronBound-WPEvents/blob/b5bdb570f5377c1a311e572547a8c29d507facf9/src/EventDispatcher.php#L175-L194
200,855
iron-bound-designs/IronBound-WPEvents
src/EventDispatcher.php
EventDispatcher.remove_subscriber
public function remove_subscriber( EventSubscriber $subscriber ) { foreach ( $subscriber->get_subscribed_events() as $event => $params ) { if ( is_string( $params ) ) { $this->add_listener( $event, $params ); } elseif ( is_array( $params ) && isset( $params[0] ) ) { $method = $params[0]; $prior...
php
public function remove_subscriber( EventSubscriber $subscriber ) { foreach ( $subscriber->get_subscribed_events() as $event => $params ) { if ( is_string( $params ) ) { $this->add_listener( $event, $params ); } elseif ( is_array( $params ) && isset( $params[0] ) ) { $method = $params[0]; $prior...
[ "public", "function", "remove_subscriber", "(", "EventSubscriber", "$", "subscriber", ")", "{", "foreach", "(", "$", "subscriber", "->", "get_subscribed_events", "(", ")", "as", "$", "event", "=>", "$", "params", ")", "{", "if", "(", "is_string", "(", "$", ...
Remove an event subscriber. This iterates over all of the subscribers events, and removes them as listeners. @since 1.0 @param EventSubscriber $subscriber @return self
[ "Remove", "an", "event", "subscriber", "." ]
b5bdb570f5377c1a311e572547a8c29d507facf9
https://github.com/iron-bound-designs/IronBound-WPEvents/blob/b5bdb570f5377c1a311e572547a8c29d507facf9/src/EventDispatcher.php#L207-L225
200,856
iron-bound-designs/IronBound-WPEvents
src/EventDispatcher.php
EventDispatcher.get_listener_priority
public function get_listener_priority( $event_name, $listener ) { if ( ! is_callable( $listener, true ) ) { throw new InvalidListenerException( '$listener must be callable.' ); } $priority = has_filter( $event_name, $listener ); if ( false === $priority ) { return null; } return $priority; }
php
public function get_listener_priority( $event_name, $listener ) { if ( ! is_callable( $listener, true ) ) { throw new InvalidListenerException( '$listener must be callable.' ); } $priority = has_filter( $event_name, $listener ); if ( false === $priority ) { return null; } return $priority; }
[ "public", "function", "get_listener_priority", "(", "$", "event_name", ",", "$", "listener", ")", "{", "if", "(", "!", "is_callable", "(", "$", "listener", ",", "true", ")", ")", "{", "throw", "new", "InvalidListenerException", "(", "'$listener must be callable....
Get the listener priority for a given event. Lower priority listeners are evaluated earlier. @since 1.0 @param string $event_name The fully-qualified event name. @param callable $listener The listener to check against. @return int|null
[ "Get", "the", "listener", "priority", "for", "a", "given", "event", "." ]
b5bdb570f5377c1a311e572547a8c29d507facf9
https://github.com/iron-bound-designs/IronBound-WPEvents/blob/b5bdb570f5377c1a311e572547a8c29d507facf9/src/EventDispatcher.php#L252-L265
200,857
zewadesign/framework
Zewa/Config.php
Config.loadConfigFile
protected function loadConfigFile(string $key) { $key = strtolower($key); $filename = $this->path . DIRECTORY_SEPARATOR . ucfirst($key) . Config::CONFIG_FILE_EXTENSION; if (file_exists($filename)) { $this->configuration[$key] = require $filename; return; } ...
php
protected function loadConfigFile(string $key) { $key = strtolower($key); $filename = $this->path . DIRECTORY_SEPARATOR . ucfirst($key) . Config::CONFIG_FILE_EXTENSION; if (file_exists($filename)) { $this->configuration[$key] = require $filename; return; } ...
[ "protected", "function", "loadConfigFile", "(", "string", "$", "key", ")", "{", "$", "key", "=", "strtolower", "(", "$", "key", ")", ";", "$", "filename", "=", "$", "this", "->", "path", ".", "DIRECTORY_SEPARATOR", ".", "ucfirst", "(", "$", "key", ")",...
Loads a configuration file in to memory @param $key @throws ConfigException when file is missing
[ "Loads", "a", "configuration", "file", "in", "to", "memory" ]
be74e41c674ac2c2ef924752ed310cfbaafe33b8
https://github.com/zewadesign/framework/blob/be74e41c674ac2c2ef924752ed310cfbaafe33b8/Zewa/Config.php#L57-L68
200,858
zewadesign/framework
Zewa/Config.php
Config.get
public function get(string $key) { $key = strtolower($key); if (empty($this->configuration[$key])) { $this->loadConfigFile($key); } return $this->configuration[$key]; }
php
public function get(string $key) { $key = strtolower($key); if (empty($this->configuration[$key])) { $this->loadConfigFile($key); } return $this->configuration[$key]; }
[ "public", "function", "get", "(", "string", "$", "key", ")", "{", "$", "key", "=", "strtolower", "(", "$", "key", ")", ";", "if", "(", "empty", "(", "$", "this", "->", "configuration", "[", "$", "key", "]", ")", ")", "{", "$", "this", "->", "lo...
Get Configuration Item @param $key @return \stdClass @throws ConfigException when config file not found
[ "Get", "Configuration", "Item" ]
be74e41c674ac2c2ef924752ed310cfbaafe33b8
https://github.com/zewadesign/framework/blob/be74e41c674ac2c2ef924752ed310cfbaafe33b8/Zewa/Config.php#L78-L87
200,859
Appsco/appsco-php-client
src/Appsco/Dashboard/ApiBundle/Client/AppscoClient.php
AppscoClient.addDashboardIcon
public function addDashboardIcon($dashboardRoleId, $appTemplateId) { $url = sprintf('%s://%s%s/api/v1/dashboard/%s/application', $this->scheme, $this->domain, $this->sufix, $dashboardRoleId); if ($this->logger) { $this->logger->info('Appsco.AppscoClient.addDashboardIcon', array( ...
php
public function addDashboardIcon($dashboardRoleId, $appTemplateId) { $url = sprintf('%s://%s%s/api/v1/dashboard/%s/application', $this->scheme, $this->domain, $this->sufix, $dashboardRoleId); if ($this->logger) { $this->logger->info('Appsco.AppscoClient.addDashboardIcon', array( ...
[ "public", "function", "addDashboardIcon", "(", "$", "dashboardRoleId", ",", "$", "appTemplateId", ")", "{", "$", "url", "=", "sprintf", "(", "'%s://%s%s/api/v1/dashboard/%s/application'", ",", "$", "this", "->", "scheme", ",", "$", "this", "->", "domain", ",", ...
Creates a dashboard icon @param int $dashboardRoleId @param int $appTemplateId
[ "Creates", "a", "dashboard", "icon" ]
1109a639c529488be41aee98165c286b3ca3d550
https://github.com/Appsco/appsco-php-client/blob/1109a639c529488be41aee98165c286b3ca3d550/src/Appsco/Dashboard/ApiBundle/Client/AppscoClient.php#L330-L357
200,860
Tom-Millard/php-class-gen
src/Config.php
Config.evaluateArgs
public function evaluateArgs(array $args) : void { array_shift($args); if (count($args) < 2) { $this->out->red("Not enough arguments: expects 2, got ".(count($args) - 1)."."); return; } $this->setName($args[0]); $this->setLocation($args[1]); ...
php
public function evaluateArgs(array $args) : void { array_shift($args); if (count($args) < 2) { $this->out->red("Not enough arguments: expects 2, got ".(count($args) - 1)."."); return; } $this->setName($args[0]); $this->setLocation($args[1]); ...
[ "public", "function", "evaluateArgs", "(", "array", "$", "args", ")", ":", "void", "{", "array_shift", "(", "$", "args", ")", ";", "if", "(", "count", "(", "$", "args", ")", "<", "2", ")", "{", "$", "this", "->", "out", "->", "red", "(", "\"Not e...
Take in an array of args and evalutate them @param array $args @return void
[ "Take", "in", "an", "array", "of", "args", "and", "evalutate", "them" ]
a4c06620589a63a98b3b64c9f64b9a85d754810e
https://github.com/Tom-Millard/php-class-gen/blob/a4c06620589a63a98b3b64c9f64b9a85d754810e/src/Config.php#L34-L50
200,861
Tom-Millard/php-class-gen
src/Config.php
Config.additionalArgs
public function additionalArgs(array $args) : void { foreach ($args as $a) { //match --extends if (substr($a, 0, strlen("--extends=")) == "--extends=") { $this->extends = explode("=", $a); $this->extends = $this->extends[1]; continue; ...
php
public function additionalArgs(array $args) : void { foreach ($args as $a) { //match --extends if (substr($a, 0, strlen("--extends=")) == "--extends=") { $this->extends = explode("=", $a); $this->extends = $this->extends[1]; continue; ...
[ "public", "function", "additionalArgs", "(", "array", "$", "args", ")", ":", "void", "{", "foreach", "(", "$", "args", "as", "$", "a", ")", "{", "//match --extends", "if", "(", "substr", "(", "$", "a", ",", "0", ",", "strlen", "(", "\"--extends=\"", ...
Evaluate optional additional args @param array $args @return void
[ "Evaluate", "optional", "additional", "args" ]
a4c06620589a63a98b3b64c9f64b9a85d754810e
https://github.com/Tom-Millard/php-class-gen/blob/a4c06620589a63a98b3b64c9f64b9a85d754810e/src/Config.php#L58-L78
200,862
kaiohken1982/NeobazaarDocumentModule
src/Document/Model/Classified/AbstractModel.php
AbstractModel.getStateFormatted
protected function getStateFormatted(Document $document) { switch($document->getState()) { case Document::DOCUMENT_STATE_ACTIVE: $this->stateClass = 'success'; return 'Attivo'; break; case Document::DOCUMENT_STATE_DEACTIVE: $this->stateClass = 'warning'; return 'Disattivo'; break; c...
php
protected function getStateFormatted(Document $document) { switch($document->getState()) { case Document::DOCUMENT_STATE_ACTIVE: $this->stateClass = 'success'; return 'Attivo'; break; case Document::DOCUMENT_STATE_DEACTIVE: $this->stateClass = 'warning'; return 'Disattivo'; break; c...
[ "protected", "function", "getStateFormatted", "(", "Document", "$", "document", ")", "{", "switch", "(", "$", "document", "->", "getState", "(", ")", ")", "{", "case", "Document", "::", "DOCUMENT_STATE_ACTIVE", ":", "$", "this", "->", "stateClass", "=", "'su...
This will fill the stateClass as well @param Document $document @return string
[ "This", "will", "fill", "the", "stateClass", "as", "well" ]
edb0223878fe02e791d2a0266c5a7c0f2029e3fe
https://github.com/kaiohken1982/NeobazaarDocumentModule/blob/edb0223878fe02e791d2a0266c5a7c0f2029e3fe/src/Document/Model/Classified/AbstractModel.php#L81-L100
200,863
kaiohken1982/NeobazaarDocumentModule
src/Document/Model/Classified/AbstractModel.php
AbstractModel.getIsExpired
protected function getIsExpired(Document $document) { $date = null === $document->getDateEdit() ? $document->getDateInsert() : $document->getDateEdit(); $now = new \Datetime("now"); $interval = $date->diff($now); if ($interval->y > 0) { return true; } return $interval->m >= 6; }
php
protected function getIsExpired(Document $document) { $date = null === $document->getDateEdit() ? $document->getDateInsert() : $document->getDateEdit(); $now = new \Datetime("now"); $interval = $date->diff($now); if ($interval->y > 0) { return true; } return $interval->m >= 6; }
[ "protected", "function", "getIsExpired", "(", "Document", "$", "document", ")", "{", "$", "date", "=", "null", "===", "$", "document", "->", "getDateEdit", "(", ")", "?", "$", "document", "->", "getDateInsert", "(", ")", ":", "$", "document", "->", "getD...
If the classified is >= 6 months old is expired @param Document $document @return boolean
[ "If", "the", "classified", "is", ">", "=", "6", "months", "old", "is", "expired" ]
edb0223878fe02e791d2a0266c5a7c0f2029e3fe
https://github.com/kaiohken1982/NeobazaarDocumentModule/blob/edb0223878fe02e791d2a0266c5a7c0f2029e3fe/src/Document/Model/Classified/AbstractModel.php#L108-L119
200,864
kaiohken1982/NeobazaarDocumentModule
src/Document/Model/Classified/AbstractModel.php
AbstractModel.getUserHashId
protected function getUserHashId(Document $document, $sm) { $user = $document->getUser(); $main = $sm->get('neobazaar.service.main'); $userRepository = $main->getUserEntityRepository(); //$this->userIdNoHash = $user->getUserId(); // we do not want to give this info return $userRepository->getEncryptedId(...
php
protected function getUserHashId(Document $document, $sm) { $user = $document->getUser(); $main = $sm->get('neobazaar.service.main'); $userRepository = $main->getUserEntityRepository(); //$this->userIdNoHash = $user->getUserId(); // we do not want to give this info return $userRepository->getEncryptedId(...
[ "protected", "function", "getUserHashId", "(", "Document", "$", "document", ",", "$", "sm", ")", "{", "$", "user", "=", "$", "document", "->", "getUser", "(", ")", ";", "$", "main", "=", "$", "sm", "->", "get", "(", "'neobazaar.service.main'", ")", ";"...
Return the user hash id for the classified. It's an sha1 hash. Also fill userIdNoHash @param Document $document @return string
[ "Return", "the", "user", "hash", "id", "for", "the", "classified", ".", "It", "s", "an", "sha1", "hash", ".", "Also", "fill", "userIdNoHash" ]
edb0223878fe02e791d2a0266c5a7c0f2029e3fe
https://github.com/kaiohken1982/NeobazaarDocumentModule/blob/edb0223878fe02e791d2a0266c5a7c0f2029e3fe/src/Document/Model/Classified/AbstractModel.php#L152-L160
200,865
kaiohken1982/NeobazaarDocumentModule
src/Document/Model/Classified/AbstractModel.php
AbstractModel.getEditAddress
protected function getEditAddress(Document $document) { $key = null === $this->hashId ? $this->getHashId($document) : $this->hashId; return '/edit-classified/' . $key . '.html'; }
php
protected function getEditAddress(Document $document) { $key = null === $this->hashId ? $this->getHashId($document) : $this->hashId; return '/edit-classified/' . $key . '.html'; }
[ "protected", "function", "getEditAddress", "(", "Document", "$", "document", ")", "{", "$", "key", "=", "null", "===", "$", "this", "->", "hashId", "?", "$", "this", "->", "getHashId", "(", "$", "document", ")", ":", "$", "this", "->", "hashId", ";", ...
Get the address to be called to edit classified @param Document $document @return string
[ "Get", "the", "address", "to", "be", "called", "to", "edit", "classified" ]
edb0223878fe02e791d2a0266c5a7c0f2029e3fe
https://github.com/kaiohken1982/NeobazaarDocumentModule/blob/edb0223878fe02e791d2a0266c5a7c0f2029e3fe/src/Document/Model/Classified/AbstractModel.php#L168-L174
200,866
kaiohken1982/NeobazaarDocumentModule
src/Document/Model/Classified/AbstractModel.php
AbstractModel.getHashId
protected function getHashId(Document $document, $sm) { $main = $sm->get('neobazaar.service.main'); $documentRepository = $main->getDocumentEntityRepository(); return $documentRepository->getEncryptedId($document->getDocumentId()); }
php
protected function getHashId(Document $document, $sm) { $main = $sm->get('neobazaar.service.main'); $documentRepository = $main->getDocumentEntityRepository(); return $documentRepository->getEncryptedId($document->getDocumentId()); }
[ "protected", "function", "getHashId", "(", "Document", "$", "document", ",", "$", "sm", ")", "{", "$", "main", "=", "$", "sm", "->", "get", "(", "'neobazaar.service.main'", ")", ";", "$", "documentRepository", "=", "$", "main", "->", "getDocumentEntityReposi...
Return the classified hash id. It's an sha1 hash @param Document $document @return string
[ "Return", "the", "classified", "hash", "id", ".", "It", "s", "an", "sha1", "hash" ]
edb0223878fe02e791d2a0266c5a7c0f2029e3fe
https://github.com/kaiohken1982/NeobazaarDocumentModule/blob/edb0223878fe02e791d2a0266c5a7c0f2029e3fe/src/Document/Model/Classified/AbstractModel.php#L204-L209
200,867
kaiohken1982/NeobazaarDocumentModule
src/Document/Model/Classified/AbstractModel.php
AbstractModel.getAddress
protected function getAddress(Document $document, $sm) { $firstCategory = null === $this->category ? $this->getCategory($document) : $this->category; $key = null === $this->hashId ? $this->getHashId($document, $sm) : $this->hashId; $slug = null === $this->slug ? $this->getSlug($document) : $th...
php
protected function getAddress(Document $document, $sm) { $firstCategory = null === $this->category ? $this->getCategory($document) : $this->category; $key = null === $this->hashId ? $this->getHashId($document, $sm) : $this->hashId; $slug = null === $this->slug ? $this->getSlug($document) : $th...
[ "protected", "function", "getAddress", "(", "Document", "$", "document", ",", "$", "sm", ")", "{", "$", "firstCategory", "=", "null", "===", "$", "this", "->", "category", "?", "$", "this", "->", "getCategory", "(", "$", "document", ")", ":", "$", "thi...
Get the classified full adress @param Document $document @return string
[ "Get", "the", "classified", "full", "adress" ]
edb0223878fe02e791d2a0266c5a7c0f2029e3fe
https://github.com/kaiohken1982/NeobazaarDocumentModule/blob/edb0223878fe02e791d2a0266c5a7c0f2029e3fe/src/Document/Model/Classified/AbstractModel.php#L217-L234
200,868
kaiohken1982/NeobazaarDocumentModule
src/Document/Model/Classified/AbstractModel.php
AbstractModel.getCategory
protected function getCategory(Document $document) { $obj = new CategoriesToRender(); $categories = $obj($document, true, true); $firstCategory = reset($categories); return $firstCategory; }
php
protected function getCategory(Document $document) { $obj = new CategoriesToRender(); $categories = $obj($document, true, true); $firstCategory = reset($categories); return $firstCategory; }
[ "protected", "function", "getCategory", "(", "Document", "$", "document", ")", "{", "$", "obj", "=", "new", "CategoriesToRender", "(", ")", ";", "$", "categories", "=", "$", "obj", "(", "$", "document", ",", "true", ",", "true", ")", ";", "$", "firstCa...
The first category as slug @param Document $document @return mixed
[ "The", "first", "category", "as", "slug" ]
edb0223878fe02e791d2a0266c5a7c0f2029e3fe
https://github.com/kaiohken1982/NeobazaarDocumentModule/blob/edb0223878fe02e791d2a0266c5a7c0f2029e3fe/src/Document/Model/Classified/AbstractModel.php#L254-L261
200,869
kaiohken1982/NeobazaarDocumentModule
src/Document/Model/Classified/AbstractModel.php
AbstractModel.getLocation
protected function getLocation(Document $document, $sm) { $main = $sm->get('neobazaar.service.main'); $location = $document->getGeoname(); if(null !== $location) { if('ADM3' == $location->getFeatureCode()) { $location = $main->getGeonamesEntityRepository()->getParent($location); } } return null...
php
protected function getLocation(Document $document, $sm) { $main = $sm->get('neobazaar.service.main'); $location = $document->getGeoname(); if(null !== $location) { if('ADM3' == $location->getFeatureCode()) { $location = $main->getGeonamesEntityRepository()->getParent($location); } } return null...
[ "protected", "function", "getLocation", "(", "Document", "$", "document", ",", "$", "sm", ")", "{", "$", "main", "=", "$", "sm", "->", "get", "(", "'neobazaar.service.main'", ")", ";", "$", "location", "=", "$", "document", "->", "getGeoname", "(", ")", ...
Get the classified location. To make the ADM2 select populated it will use the parent entity if the location is an ADM3 @param Document $document @return string
[ "Get", "the", "classified", "location", ".", "To", "make", "the", "ADM2", "select", "populated", "it", "will", "use", "the", "parent", "entity", "if", "the", "location", "is", "an", "ADM3" ]
edb0223878fe02e791d2a0266c5a7c0f2029e3fe
https://github.com/kaiohken1982/NeobazaarDocumentModule/blob/edb0223878fe02e791d2a0266c5a7c0f2029e3fe/src/Document/Model/Classified/AbstractModel.php#L271-L282
200,870
kaiohken1982/NeobazaarDocumentModule
src/Document/Model/Classified/AbstractModel.php
AbstractModel.getPurpose
protected function getPurpose(Document $document) { $value = ''; foreach($document->getMetadata() as $meta) { if('finalita' == $meta->getKey()) { $value = $meta->getValue(); break; } } return $value; }
php
protected function getPurpose(Document $document) { $value = ''; foreach($document->getMetadata() as $meta) { if('finalita' == $meta->getKey()) { $value = $meta->getValue(); break; } } return $value; }
[ "protected", "function", "getPurpose", "(", "Document", "$", "document", ")", "{", "$", "value", "=", "''", ";", "foreach", "(", "$", "document", "->", "getMetadata", "(", ")", "as", "$", "meta", ")", "{", "if", "(", "'finalita'", "==", "$", "meta", ...
Get the classified purpose @param Document $document @return string
[ "Get", "the", "classified", "purpose" ]
edb0223878fe02e791d2a0266c5a7c0f2029e3fe
https://github.com/kaiohken1982/NeobazaarDocumentModule/blob/edb0223878fe02e791d2a0266c5a7c0f2029e3fe/src/Document/Model/Classified/AbstractModel.php#L303-L314
200,871
kaiohken1982/NeobazaarDocumentModule
src/Document/Model/Classified/AbstractModel.php
AbstractModel.getHideMobile
protected function getHideMobile(Document $document) { foreach($document->getMetadata() as $meta) { if('hidemobile' == $meta->getKey()) { $v = $meta->getValue(); return $v; break; } } return false; }
php
protected function getHideMobile(Document $document) { foreach($document->getMetadata() as $meta) { if('hidemobile' == $meta->getKey()) { $v = $meta->getValue(); return $v; break; } } return false; }
[ "protected", "function", "getHideMobile", "(", "Document", "$", "document", ")", "{", "foreach", "(", "$", "document", "->", "getMetadata", "(", ")", "as", "$", "meta", ")", "{", "if", "(", "'hidemobile'", "==", "$", "meta", "->", "getKey", "(", ")", "...
Get the classified hidemobile meta value @param Document $document @return string
[ "Get", "the", "classified", "hidemobile", "meta", "value" ]
edb0223878fe02e791d2a0266c5a7c0f2029e3fe
https://github.com/kaiohken1982/NeobazaarDocumentModule/blob/edb0223878fe02e791d2a0266c5a7c0f2029e3fe/src/Document/Model/Classified/AbstractModel.php#L341-L352
200,872
ezra-obiwale/dSCore
src/Stdlib/Object.php
Object.add
public function add(array $data, $preserveArray = false, $preserveKeyOnly = null) { foreach ($data as $key => $value) { if (is_array($value) && (!$preserveArray || ($preserveArray && $preserveKeyOnly && $key !== $preserveKeyOnly))) { $this->$key = (array_key_exists(0, $value)) ? $val...
php
public function add(array $data, $preserveArray = false, $preserveKeyOnly = null) { foreach ($data as $key => $value) { if (is_array($value) && (!$preserveArray || ($preserveArray && $preserveKeyOnly && $key !== $preserveKeyOnly))) { $this->$key = (array_key_exists(0, $value)) ? $val...
[ "public", "function", "add", "(", "array", "$", "data", ",", "$", "preserveArray", "=", "false", ",", "$", "preserveKeyOnly", "=", "null", ")", "{", "foreach", "(", "$", "data", "as", "$", "key", "=>", "$", "value", ")", "{", "if", "(", "is_array", ...
Adds data to the object @param array $data @param boolean $preserveArray Indicates whether to preserve array or turn them objects too @return Object @throws \Exception
[ "Adds", "data", "to", "the", "object" ]
dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d
https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/Stdlib/Object.php#L25-L41
200,873
ezra-obiwale/dSCore
src/Stdlib/Object.php
Object.toArray
public function toArray($recursive = false) { $return = get_object_vars($this); if ($recursive) { foreach ($return as $ppt => &$val) { if ($ppt === 'integerkeys') continue; if (is_object($val) && method_exists($val, 'toArray')) { ...
php
public function toArray($recursive = false) { $return = get_object_vars($this); if ($recursive) { foreach ($return as $ppt => &$val) { if ($ppt === 'integerkeys') continue; if (is_object($val) && method_exists($val, 'toArray')) { ...
[ "public", "function", "toArray", "(", "$", "recursive", "=", "false", ")", "{", "$", "return", "=", "get_object_vars", "(", "$", "this", ")", ";", "if", "(", "$", "recursive", ")", "{", "foreach", "(", "$", "return", "as", "$", "ppt", "=>", "&", "$...
Returns array of properties @param $recursive @return array
[ "Returns", "array", "of", "properties" ]
dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d
https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/Stdlib/Object.php#L71-L84
200,874
drdplusinfo/drdplus-races
DrdPlus/Races/Race.php
Race.getBodyWeight
public function getBodyWeight(GenderCode $genderCode, Tables $tables): int { $weightInKg = $this->getWeightInKg($genderCode, $tables); return (new Weight($weightInKg, Weight::KG, $tables->getWeightTable()))->getBonus()->getValue(); }
php
public function getBodyWeight(GenderCode $genderCode, Tables $tables): int { $weightInKg = $this->getWeightInKg($genderCode, $tables); return (new Weight($weightInKg, Weight::KG, $tables->getWeightTable()))->getBonus()->getValue(); }
[ "public", "function", "getBodyWeight", "(", "GenderCode", "$", "genderCode", ",", "Tables", "$", "tables", ")", ":", "int", "{", "$", "weightInKg", "=", "$", "this", "->", "getWeightInKg", "(", "$", "genderCode", ",", "$", "tables", ")", ";", "return", "...
Bonus of body weight @param GenderCode $genderCode @param Tables $tables @return int
[ "Bonus", "of", "body", "weight" ]
a7189555ff5235e690c5fe01afc85aec0015b21a
https://github.com/drdplusinfo/drdplus-races/blob/a7189555ff5235e690c5fe01afc85aec0015b21a/DrdPlus/Races/Race.php#L144-L149
200,875
stevenliebregt/crispysystem
src/Routing/Route.php
Route.any
public static function any(string $path, $handler) : array { return [ static::get($path, $handler), static::post($path, $handler), static::put($path, $handler), static::patch($path, $handler), static::delete($path, $handler), ]; }
php
public static function any(string $path, $handler) : array { return [ static::get($path, $handler), static::post($path, $handler), static::put($path, $handler), static::patch($path, $handler), static::delete($path, $handler), ]; }
[ "public", "static", "function", "any", "(", "string", "$", "path", ",", "$", "handler", ")", ":", "array", "{", "return", "[", "static", "::", "get", "(", "$", "path", ",", "$", "handler", ")", ",", "static", "::", "post", "(", "$", "path", ",", ...
Add a route that matches any HTTP verb @param string $path @param $handler @return array @since 1.4.0
[ "Add", "a", "route", "that", "matches", "any", "HTTP", "verb" ]
06547dae100dae1023a93ec903f2d2abacce9aec
https://github.com/stevenliebregt/crispysystem/blob/06547dae100dae1023a93ec903f2d2abacce9aec/src/Routing/Route.php#L144-L153
200,876
stevenliebregt/crispysystem
src/Routing/Route.php
Route.match
public static function match(array $verbs, string $path, $handler) : array { $routes = []; foreach ($verbs as $verb) { switch (strtolower($verb)) { case 'get': $routes[] = static::get($path, $handler); break; case '...
php
public static function match(array $verbs, string $path, $handler) : array { $routes = []; foreach ($verbs as $verb) { switch (strtolower($verb)) { case 'get': $routes[] = static::get($path, $handler); break; case '...
[ "public", "static", "function", "match", "(", "array", "$", "verbs", ",", "string", "$", "path", ",", "$", "handler", ")", ":", "array", "{", "$", "routes", "=", "[", "]", ";", "foreach", "(", "$", "verbs", "as", "$", "verb", ")", "{", "switch", ...
Add a route that matches the given HTTP verbs @param array $verbs @param string $path @param $handler @return array @since 1.4.0
[ "Add", "a", "route", "that", "matches", "the", "given", "HTTP", "verbs" ]
06547dae100dae1023a93ec903f2d2abacce9aec
https://github.com/stevenliebregt/crispysystem/blob/06547dae100dae1023a93ec903f2d2abacce9aec/src/Routing/Route.php#L163-L188
200,877
stevenliebregt/crispysystem
src/Routing/Route.php
Route.add
protected static function add(string $verb, string $path, $handler) : Route { /** @var Router $router */ $router = static::getRouterInstance(); $route = new static($router, $verb, $path, $handler); Router::addRoute($verb, $route); return $route; }
php
protected static function add(string $verb, string $path, $handler) : Route { /** @var Router $router */ $router = static::getRouterInstance(); $route = new static($router, $verb, $path, $handler); Router::addRoute($verb, $route); return $route; }
[ "protected", "static", "function", "add", "(", "string", "$", "verb", ",", "string", "$", "path", ",", "$", "handler", ")", ":", "Route", "{", "/** @var Router $router */", "$", "router", "=", "static", "::", "getRouterInstance", "(", ")", ";", "$", "route...
Creates a new route @param string $verb @param string $path @param $handler @return Route @since 1.0.0
[ "Creates", "a", "new", "route" ]
06547dae100dae1023a93ec903f2d2abacce9aec
https://github.com/stevenliebregt/crispysystem/blob/06547dae100dae1023a93ec903f2d2abacce9aec/src/Routing/Route.php#L198-L208
200,878
stevenliebregt/crispysystem
src/Routing/Route.php
Route.createRegex
public function createRegex() { $parts = explode('/', ltrim($this->path, '/')); $regex = '/^'; // Matches the start of the string foreach ($parts as $part) { $regex .= '\/'; // Matches starting slash // Handle non-variable parts if (stripos($part, '{') ===...
php
public function createRegex() { $parts = explode('/', ltrim($this->path, '/')); $regex = '/^'; // Matches the start of the string foreach ($parts as $part) { $regex .= '\/'; // Matches starting slash // Handle non-variable parts if (stripos($part, '{') ===...
[ "public", "function", "createRegex", "(", ")", "{", "$", "parts", "=", "explode", "(", "'/'", ",", "ltrim", "(", "$", "this", "->", "path", ",", "'/'", ")", ")", ";", "$", "regex", "=", "'/^'", ";", "// Matches the start of the string", "foreach", "(", ...
Creates a regular expression to match the route @since 1.0.0
[ "Creates", "a", "regular", "expression", "to", "match", "the", "route" ]
06547dae100dae1023a93ec903f2d2abacce9aec
https://github.com/stevenliebregt/crispysystem/blob/06547dae100dae1023a93ec903f2d2abacce9aec/src/Routing/Route.php#L280-L306
200,879
phpffcms/ffcms-core
src/Network/Request/MultiLanguageFeatures.php
MultiLanguageFeatures.runMultiLanguage
private function runMultiLanguage(): void { // check if multi-language is enabled if (!App::$Properties->get('multiLanguage')) { $this->language = App::$Properties->get('singleLanguage'); return; } // check if domain-lang binding is enabled if (Any::i...
php
private function runMultiLanguage(): void { // check if multi-language is enabled if (!App::$Properties->get('multiLanguage')) { $this->language = App::$Properties->get('singleLanguage'); return; } // check if domain-lang binding is enabled if (Any::i...
[ "private", "function", "runMultiLanguage", "(", ")", ":", "void", "{", "// check if multi-language is enabled", "if", "(", "!", "App", "::", "$", "Properties", "->", "get", "(", "'multiLanguage'", ")", ")", "{", "$", "this", "->", "language", "=", "App", "::...
Build multi language pathway binding. @return void
[ "Build", "multi", "language", "pathway", "binding", "." ]
44a309553ef9f115ccfcfd71f2ac6e381c612082
https://github.com/phpffcms/ffcms-core/blob/44a309553ef9f115ccfcfd71f2ac6e381c612082/src/Network/Request/MultiLanguageFeatures.php#L27-L62
200,880
phpffcms/ffcms-core
src/Network/Request/MultiLanguageFeatures.php
MultiLanguageFeatures.setLanguageFromBrowser
private function setLanguageFromBrowser(): void { $userLang = App::$Properties->get('singleLanguage'); $browserAccept = $this->getLanguages(); if (Any::isArray($browserAccept) && count($browserAccept) > 0) { foreach ($browserAccept as $bLang) { if (Arr::in($bLang,...
php
private function setLanguageFromBrowser(): void { $userLang = App::$Properties->get('singleLanguage'); $browserAccept = $this->getLanguages(); if (Any::isArray($browserAccept) && count($browserAccept) > 0) { foreach ($browserAccept as $bLang) { if (Arr::in($bLang,...
[ "private", "function", "setLanguageFromBrowser", "(", ")", ":", "void", "{", "$", "userLang", "=", "App", "::", "$", "Properties", "->", "get", "(", "'singleLanguage'", ")", ";", "$", "browserAccept", "=", "$", "this", "->", "getLanguages", "(", ")", ";", ...
Set language from browser headers @return void
[ "Set", "language", "from", "browser", "headers" ]
44a309553ef9f115ccfcfd71f2ac6e381c612082
https://github.com/phpffcms/ffcms-core/blob/44a309553ef9f115ccfcfd71f2ac6e381c612082/src/Network/Request/MultiLanguageFeatures.php#L68-L92
200,881
praxigento/mobi_mod_downline
Service/Snap/Calc/A/ComposeUpdates.php
ComposeUpdates.composeSnapItem
private function composeSnapItem($customerId, $parentId, $dsChanged, $snap) { $result = new ESnap(); $result->setCustomerRef($customerId); $result->setParentRef($parentId); $result->setDate($dsChanged); if ($customerId == $parentId) { /* this is root node customer...
php
private function composeSnapItem($customerId, $parentId, $dsChanged, $snap) { $result = new ESnap(); $result->setCustomerRef($customerId); $result->setParentRef($parentId); $result->setDate($dsChanged); if ($customerId == $parentId) { /* this is root node customer...
[ "private", "function", "composeSnapItem", "(", "$", "customerId", ",", "$", "parentId", ",", "$", "dsChanged", ",", "$", "snap", ")", "{", "$", "result", "=", "new", "ESnap", "(", ")", ";", "$", "result", "->", "setCustomerRef", "(", "$", "customerId", ...
Compose snapshot item. @param int $customerId @param int $parentId @param string $dsChanged @param ESnap[] $snap @return ESnap
[ "Compose", "snapshot", "item", "." ]
0f3c276dfff1aa029f9fd205ccfc56f207a2e75b
https://github.com/praxigento/mobi_mod_downline/blob/0f3c276dfff1aa029f9fd205ccfc56f207a2e75b/Service/Snap/Calc/A/ComposeUpdates.php#L139-L162
200,882
ColonelBlimp/NsanjaConfig
src/Nsanja/Platform/Config/ConfigurationAbstract.php
ConfigurationAbstract.getArrayValue
final protected function getArrayValue(string $key): array { $value = $this->getConfigValue($key); if (!$value || !\is_array($value)) { return []; } return $value; }
php
final protected function getArrayValue(string $key): array { $value = $this->getConfigValue($key); if (!$value || !\is_array($value)) { return []; } return $value; }
[ "final", "protected", "function", "getArrayValue", "(", "string", "$", "key", ")", ":", "array", "{", "$", "value", "=", "$", "this", "->", "getConfigValue", "(", "$", "key", ")", ";", "if", "(", "!", "$", "value", "||", "!", "\\", "is_array", "(", ...
Returns an array value. @param string $key @return array
[ "Returns", "an", "array", "value", "." ]
d23609c6cd00f7c524f122b16c532681b8c489be
https://github.com/ColonelBlimp/NsanjaConfig/blob/d23609c6cd00f7c524f122b16c532681b8c489be/src/Nsanja/Platform/Config/ConfigurationAbstract.php#L105-L113
200,883
ColonelBlimp/NsanjaConfig
src/Nsanja/Platform/Config/ConfigurationAbstract.php
ConfigurationAbstract.getStringValue
final protected function getStringValue(string $key, string $default = ''): string { $value = $this->getConfigValue($key); if (!$value) { return $default; } return strval($value); }
php
final protected function getStringValue(string $key, string $default = ''): string { $value = $this->getConfigValue($key); if (!$value) { return $default; } return strval($value); }
[ "final", "protected", "function", "getStringValue", "(", "string", "$", "key", ",", "string", "$", "default", "=", "''", ")", ":", "string", "{", "$", "value", "=", "$", "this", "->", "getConfigValue", "(", "$", "key", ")", ";", "if", "(", "!", "$", ...
Retrieves a string configuration parameter. @param string $key The for the value. @param string $default The default value if not found (empty string) @return string The value.
[ "Retrieves", "a", "string", "configuration", "parameter", "." ]
d23609c6cd00f7c524f122b16c532681b8c489be
https://github.com/ColonelBlimp/NsanjaConfig/blob/d23609c6cd00f7c524f122b16c532681b8c489be/src/Nsanja/Platform/Config/ConfigurationAbstract.php#L137-L145
200,884
ColonelBlimp/NsanjaConfig
src/Nsanja/Platform/Config/ConfigurationAbstract.php
ConfigurationAbstract.getBooleanValue
final protected function getBooleanValue(string $key, bool $default = false): bool { $value = $this->getConfigValue($key); if (!$value) { return $default; } return \boolval($value); }
php
final protected function getBooleanValue(string $key, bool $default = false): bool { $value = $this->getConfigValue($key); if (!$value) { return $default; } return \boolval($value); }
[ "final", "protected", "function", "getBooleanValue", "(", "string", "$", "key", ",", "bool", "$", "default", "=", "false", ")", ":", "bool", "{", "$", "value", "=", "$", "this", "->", "getConfigValue", "(", "$", "key", ")", ";", "if", "(", "!", "$", ...
Retrieves a boolean configuration parameter. @param string $key The key for the value. @param bool $default The default value if not found (false) @return bool The value
[ "Retrieves", "a", "boolean", "configuration", "parameter", "." ]
d23609c6cd00f7c524f122b16c532681b8c489be
https://github.com/ColonelBlimp/NsanjaConfig/blob/d23609c6cd00f7c524f122b16c532681b8c489be/src/Nsanja/Platform/Config/ConfigurationAbstract.php#L153-L161
200,885
ColonelBlimp/NsanjaConfig
src/Nsanja/Platform/Config/ConfigurationAbstract.php
ConfigurationAbstract.isBaseConfigPropertiesSet
private function isBaseConfigPropertiesSet(): bool { return isset( $this->config[ConfigurationInterface::KEY_APP_ROOT], $this->config[ConfigurationInterface::KEY_CONFIG_ROOT], $this->config[ConfigurationInterface::KEY_CACHE_ROOT], $this->config[ConfigurationIn...
php
private function isBaseConfigPropertiesSet(): bool { return isset( $this->config[ConfigurationInterface::KEY_APP_ROOT], $this->config[ConfigurationInterface::KEY_CONFIG_ROOT], $this->config[ConfigurationInterface::KEY_CACHE_ROOT], $this->config[ConfigurationIn...
[ "private", "function", "isBaseConfigPropertiesSet", "(", ")", ":", "bool", "{", "return", "isset", "(", "$", "this", "->", "config", "[", "ConfigurationInterface", "::", "KEY_APP_ROOT", "]", ",", "$", "this", "->", "config", "[", "ConfigurationInterface", "::", ...
Checks that all the mandatory properties are set. @return bool Return <code>true</code> if all the properties are set, otherwise <code>false</code>.
[ "Checks", "that", "all", "the", "mandatory", "properties", "are", "set", "." ]
d23609c6cd00f7c524f122b16c532681b8c489be
https://github.com/ColonelBlimp/NsanjaConfig/blob/d23609c6cd00f7c524f122b16c532681b8c489be/src/Nsanja/Platform/Config/ConfigurationAbstract.php#L167-L176
200,886
inc2734/wp-page-speed-optimization
src/App/Controller/Menu.php
Menu._pre_wp_nav_menu
public function _pre_wp_nav_menu( $output, $args ) { if ( is_customize_preview() ) { return $output; } // For the nav menu widget. if ( ! $args->theme_location ) { return $output; } if ( ! $this->_is_caching_nav_menus() ) { return $output; } if ( ! $this->_is_caching_nav_menu( $args->theme_l...
php
public function _pre_wp_nav_menu( $output, $args ) { if ( is_customize_preview() ) { return $output; } // For the nav menu widget. if ( ! $args->theme_location ) { return $output; } if ( ! $this->_is_caching_nav_menus() ) { return $output; } if ( ! $this->_is_caching_nav_menu( $args->theme_l...
[ "public", "function", "_pre_wp_nav_menu", "(", "$", "output", ",", "$", "args", ")", "{", "if", "(", "is_customize_preview", "(", ")", ")", "{", "return", "$", "output", ";", "}", "// For the nav menu widget.", "if", "(", "!", "$", "args", "->", "theme_loc...
Output nav menu @param string $output HTML @param array $args @return string
[ "Output", "nav", "menu" ]
219963582b592eef4bde6cdd4ed1cf0dc71a6114
https://github.com/inc2734/wp-page-speed-optimization/blob/219963582b592eef4bde6cdd4ed1cf0dc71a6114/src/App/Controller/Menu.php#L95-L119
200,887
inc2734/wp-page-speed-optimization
src/App/Controller/Menu.php
Menu._remove_current_classes
public function _remove_current_classes( $items, $args ) { if ( is_customize_preview() ) { return $items; } if ( ! static::_is_caching_nav_menus() ) { return $items; } if ( ! $this->_is_caching_nav_menu( $args->theme_location ) ) { return $items; } foreach ( $items as $items_index => $item ) {...
php
public function _remove_current_classes( $items, $args ) { if ( is_customize_preview() ) { return $items; } if ( ! static::_is_caching_nav_menus() ) { return $items; } if ( ! $this->_is_caching_nav_menu( $args->theme_location ) ) { return $items; } foreach ( $items as $items_index => $item ) {...
[ "public", "function", "_remove_current_classes", "(", "$", "items", ",", "$", "args", ")", "{", "if", "(", "is_customize_preview", "(", ")", ")", "{", "return", "$", "items", ";", "}", "if", "(", "!", "static", "::", "_is_caching_nav_menus", "(", ")", ")...
Remove current classes @param string $items The menu items, sorted by each menu item's menu order. @param stdClass $args An object containing wp_nav_menu() arguments. @return string
[ "Remove", "current", "classes" ]
219963582b592eef4bde6cdd4ed1cf0dc71a6114
https://github.com/inc2734/wp-page-speed-optimization/blob/219963582b592eef4bde6cdd4ed1cf0dc71a6114/src/App/Controller/Menu.php#L128-L150
200,888
Vectrex/vxPHP
src/Debug/Debug.php
Debug.enable
public static function enable($reportingLevel = NULL, $displayErrors = NULL) { if (!static::$enabled) { static::$enabled = true; error_reporting(E_ALL); ErrorHandler::register($reportingLevel, $displayErrors); if (PHP_SAPI !== 'cli') { ExceptionHandler::register($reportingLevel, $displayErrors);...
php
public static function enable($reportingLevel = NULL, $displayErrors = NULL) { if (!static::$enabled) { static::$enabled = true; error_reporting(E_ALL); ErrorHandler::register($reportingLevel, $displayErrors); if (PHP_SAPI !== 'cli') { ExceptionHandler::register($reportingLevel, $displayErrors);...
[ "public", "static", "function", "enable", "(", "$", "reportingLevel", "=", "NULL", ",", "$", "displayErrors", "=", "NULL", ")", "{", "if", "(", "!", "static", "::", "$", "enabled", ")", "{", "static", "::", "$", "enabled", "=", "true", ";", "error_repo...
activate custom debugging registers error handler and exception handler @param integer $reportingLevel @param boolean $displayErrors
[ "activate", "custom", "debugging", "registers", "error", "handler", "and", "exception", "handler" ]
295c21b00e7ef6085efcdf5b64fabb28d499b5a6
https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Debug/Debug.php#L30-L47
200,889
miknatr/grace-dbal
lib/Grace/SQLBuilder/WhereBuilderAbstract.php
WhereBuilderAbstract.sql
public function sql($sql, array $values = array()) { $this->whereSqlConditions[] = $sql; $this->arguments = array_merge($this->arguments, $values); return $this; }
php
public function sql($sql, array $values = array()) { $this->whereSqlConditions[] = $sql; $this->arguments = array_merge($this->arguments, $values); return $this; }
[ "public", "function", "sql", "(", "$", "sql", ",", "array", "$", "values", "=", "array", "(", ")", ")", "{", "$", "this", "->", "whereSqlConditions", "[", "]", "=", "$", "sql", ";", "$", "this", "->", "arguments", "=", "array_merge", "(", "$", "thi...
Adds sql statement into where statement @param $sql @param array $values @return $this
[ "Adds", "sql", "statement", "into", "where", "statement" ]
b05e03040568631dc6c77477c0eaed6e60db4ba2
https://github.com/miknatr/grace-dbal/blob/b05e03040568631dc6c77477c0eaed6e60db4ba2/lib/Grace/SQLBuilder/WhereBuilderAbstract.php#L27-L32
200,890
miknatr/grace-dbal
lib/Grace/SQLBuilder/WhereBuilderAbstract.php
WhereBuilderAbstract.like
public function like($field, $value) { $operator = ' ' . $this->executable->provideSqlDialect()->likeOperator() . ' '; return $this->setTwoArgsOperator($field, $value, $operator); }
php
public function like($field, $value) { $operator = ' ' . $this->executable->provideSqlDialect()->likeOperator() . ' '; return $this->setTwoArgsOperator($field, $value, $operator); }
[ "public", "function", "like", "(", "$", "field", ",", "$", "value", ")", "{", "$", "operator", "=", "' '", ".", "$", "this", "->", "executable", "->", "provideSqlDialect", "(", ")", "->", "likeOperator", "(", ")", ".", "' '", ";", "return", "$", "thi...
Adds LIKE statement into where statement @param $field @param $value @return $this
[ "Adds", "LIKE", "statement", "into", "where", "statement" ]
b05e03040568631dc6c77477c0eaed6e60db4ba2
https://github.com/miknatr/grace-dbal/blob/b05e03040568631dc6c77477c0eaed6e60db4ba2/lib/Grace/SQLBuilder/WhereBuilderAbstract.php#L168-L172
200,891
agentmedia/phine-builtin
src/BuiltIn/Modules/Backend/RegisterSimpleForm.php
RegisterSimpleForm.SaveElement
protected function SaveElement() { $this->register->SetConfirmUrl($this->selectorConfirm->Save($this->register->GetConfirmUrl())); $this->register->SetNextUrl($this->selectorNext->Save($this->register->GetNextUrl())); $this->register->SetMailFrom($this->Value('MailFrom')); $this->reg...
php
protected function SaveElement() { $this->register->SetConfirmUrl($this->selectorConfirm->Save($this->register->GetConfirmUrl())); $this->register->SetNextUrl($this->selectorNext->Save($this->register->GetNextUrl())); $this->register->SetMailFrom($this->Value('MailFrom')); $this->reg...
[ "protected", "function", "SaveElement", "(", ")", "{", "$", "this", "->", "register", "->", "SetConfirmUrl", "(", "$", "this", "->", "selectorConfirm", "->", "Save", "(", "$", "this", "->", "register", "->", "GetConfirmUrl", "(", ")", ")", ")", ";", "$",...
Saves the simple register element @return ContentRegisterSimple
[ "Saves", "the", "simple", "register", "element" ]
4dd05bc406a71e997bd4eaa16b12e23dbe62a456
https://github.com/agentmedia/phine-builtin/blob/4dd05bc406a71e997bd4eaa16b12e23dbe62a456/src/BuiltIn/Modules/Backend/RegisterSimpleForm.php#L160-L170
200,892
translationexchange/tml-php-clientsdk
library/Tr8n/Utils/HtmlTranslator.php
HtmlTranslator.prepareHtml
function prepareHtml() { // remove all tabs and new lines - as they mean nothing in HTML $this->html = trim(preg_replace('/\t\n/', '', $this->html)); // normalize multiple spaces to one space $this->html = preg_replace('/\s+/', ' ', $this->html); // replace special characters l...
php
function prepareHtml() { // remove all tabs and new lines - as they mean nothing in HTML $this->html = trim(preg_replace('/\t\n/', '', $this->html)); // normalize multiple spaces to one space $this->html = preg_replace('/\s+/', ' ', $this->html); // replace special characters l...
[ "function", "prepareHtml", "(", ")", "{", "// remove all tabs and new lines - as they mean nothing in HTML", "$", "this", "->", "html", "=", "trim", "(", "preg_replace", "(", "'/\\t\\n/'", ",", "''", ",", "$", "this", "->", "html", ")", ")", ";", "// normalize mul...
Prepares HTML for processing
[ "Prepares", "HTML", "for", "processing" ]
fe51473824e62cfd883c6aa0c6a3783a16ce8425
https://github.com/translationexchange/tml-php-clientsdk/blob/fe51473824e62cfd883c6aa0c6a3783a16ce8425/library/Tr8n/Utils/HtmlTranslator.php#L94-L109
200,893
translationexchange/tml-php-clientsdk
library/Tr8n/Utils/HtmlTranslator.php
HtmlTranslator.parseDocument
function parseDocument() { $this->prepareHtml(); $current = libxml_use_internal_errors(true); $disableEntities = libxml_disable_entity_loader(true); $charset = 'UTF-8'; $this->doc = new \DOMDocument('1.0', $charset); $this->doc->strictErrorChecking = false; @$t...
php
function parseDocument() { $this->prepareHtml(); $current = libxml_use_internal_errors(true); $disableEntities = libxml_disable_entity_loader(true); $charset = 'UTF-8'; $this->doc = new \DOMDocument('1.0', $charset); $this->doc->strictErrorChecking = false; @$t...
[ "function", "parseDocument", "(", ")", "{", "$", "this", "->", "prepareHtml", "(", ")", ";", "$", "current", "=", "libxml_use_internal_errors", "(", "true", ")", ";", "$", "disableEntities", "=", "libxml_disable_entity_loader", "(", "true", ")", ";", "$", "c...
Parses the HTML document
[ "Parses", "the", "HTML", "document" ]
fe51473824e62cfd883c6aa0c6a3783a16ce8425
https://github.com/translationexchange/tml-php-clientsdk/blob/fe51473824e62cfd883c6aa0c6a3783a16ce8425/library/Tr8n/Utils/HtmlTranslator.php#L114-L128
200,894
translationexchange/tml-php-clientsdk
library/Tr8n/Utils/HtmlTranslator.php
HtmlTranslator.generateTmlTags
private function generateTmlTags($node) { $buffer = ""; foreach($node->childNodes as $child) { if ($child->nodeType == 3) { // text node $buffer = $buffer . $child->wholeText; } else { $buffer = $buffer . $this->generateTmlTags($...
php
private function generateTmlTags($node) { $buffer = ""; foreach($node->childNodes as $child) { if ($child->nodeType == 3) { // text node $buffer = $buffer . $child->wholeText; } else { $buffer = $buffer . $this->generateTmlTags($...
[ "private", "function", "generateTmlTags", "(", "$", "node", ")", "{", "$", "buffer", "=", "\"\"", ";", "foreach", "(", "$", "node", "->", "childNodes", "as", "$", "child", ")", "{", "if", "(", "$", "child", "->", "nodeType", "==", "3", ")", "{", "/...
TML nodes can be nested - but they CANNOT contain non-inline nodes @param $node @return string
[ "TML", "nodes", "can", "be", "nested", "-", "but", "they", "CANNOT", "contain", "non", "-", "inline", "nodes" ]
fe51473824e62cfd883c6aa0c6a3783a16ce8425
https://github.com/translationexchange/tml-php-clientsdk/blob/fe51473824e62cfd883c6aa0c6a3783a16ce8425/library/Tr8n/Utils/HtmlTranslator.php#L218-L241
200,895
translationexchange/tml-php-clientsdk
library/Tr8n/Utils/HtmlTranslator.php
HtmlTranslator.resetContext
private function resetContext() { $this->debug_tokens = $this->tokens; $this->tokens = array_merge(array(), $this->context); }
php
private function resetContext() { $this->debug_tokens = $this->tokens; $this->tokens = array_merge(array(), $this->context); }
[ "private", "function", "resetContext", "(", ")", "{", "$", "this", "->", "debug_tokens", "=", "$", "this", "->", "tokens", ";", "$", "this", "->", "tokens", "=", "array_merge", "(", "array", "(", ")", ",", "$", "this", "->", "context", ")", ";", "}" ...
Resets context of the current translation
[ "Resets", "context", "of", "the", "current", "translation" ]
fe51473824e62cfd883c6aa0c6a3783a16ce8425
https://github.com/translationexchange/tml-php-clientsdk/blob/fe51473824e62cfd883c6aa0c6a3783a16ce8425/library/Tr8n/Utils/HtmlTranslator.php#L275-L278
200,896
irfantoor/engine
src/Http/Cookie.php
Cookie.send
function send() { if (!headers_sent()) { extract($this->toArray()); setcookie($name, $value, $expires, $path, $domain, $secure, $httponly); } }
php
function send() { if (!headers_sent()) { extract($this->toArray()); setcookie($name, $value, $expires, $path, $domain, $secure, $httponly); } }
[ "function", "send", "(", ")", "{", "if", "(", "!", "headers_sent", "(", ")", ")", "{", "extract", "(", "$", "this", "->", "toArray", "(", ")", ")", ";", "setcookie", "(", "$", "name", ",", "$", "value", ",", "$", "expires", ",", "$", "path", ",...
Sets the cookie to be sent by the headers
[ "Sets", "the", "cookie", "to", "be", "sent", "by", "the", "headers" ]
4d2d221add749f75100d0b4ffe1488cdbf7af5d3
https://github.com/irfantoor/engine/blob/4d2d221add749f75100d0b4ffe1488cdbf7af5d3/src/Http/Cookie.php#L80-L86
200,897
romm/configuration_object
Classes/Service/Items/MixedTypes/MixedTypesResolver.php
MixedTypesResolver.addError
public function addError(Error $error) { $this->result->addError($error); $this->setObjectType(self::OBJECT_TYPE_NONE); }
php
public function addError(Error $error) { $this->result->addError($error); $this->setObjectType(self::OBJECT_TYPE_NONE); }
[ "public", "function", "addError", "(", "Error", "$", "error", ")", "{", "$", "this", "->", "result", "->", "addError", "(", "$", "error", ")", ";", "$", "this", "->", "setObjectType", "(", "self", "::", "OBJECT_TYPE_NONE", ")", ";", "}" ]
Adds an error to the processor, which may then be merged with the errors of the property being currently mapped. It will also set the object type to `null`, because if there is an error, the property can probably not being converted correctly. @param Error $error
[ "Adds", "an", "error", "to", "the", "processor", "which", "may", "then", "be", "merged", "with", "the", "errors", "of", "the", "property", "being", "currently", "mapped", "." ]
d3a40903386c2e0766bd8279337fe6da45cf5ce3
https://github.com/romm/configuration_object/blob/d3a40903386c2e0766bd8279337fe6da45cf5ce3/Classes/Service/Items/MixedTypes/MixedTypesResolver.php#L67-L71
200,898
modulusphp/http
Session.php
Session.key
public static function key($key, $value = null) { if ($value == null) return $_SESSION[$key]; $_SESSION[$key] = $value; }
php
public static function key($key, $value = null) { if ($value == null) return $_SESSION[$key]; $_SESSION[$key] = $value; }
[ "public", "static", "function", "key", "(", "$", "key", ",", "$", "value", "=", "null", ")", "{", "if", "(", "$", "value", "==", "null", ")", "return", "$", "_SESSION", "[", "$", "key", "]", ";", "$", "_SESSION", "[", "$", "key", "]", "=", "$",...
Set or get session key @param mixed $key @param mixed $value @return void
[ "Set", "or", "get", "session", "key" ]
fc5c0f2b582a04de1685578d3fb790686a0a240c
https://github.com/modulusphp/http/blob/fc5c0f2b582a04de1685578d3fb790686a0a240c/Session.php#L42-L47
200,899
modulusphp/http
Session.php
Session.flash
public static function flash(string $key, $value = null) { /** * Check if session already has variables. * * If variables have already been set, merge the new * variables with the old ones. */ return $_SESSION['application']['with'] = array_merge( ...
php
public static function flash(string $key, $value = null) { /** * Check if session already has variables. * * If variables have already been set, merge the new * variables with the old ones. */ return $_SESSION['application']['with'] = array_merge( ...
[ "public", "static", "function", "flash", "(", "string", "$", "key", ",", "$", "value", "=", "null", ")", "{", "/**\n * Check if session already has variables.\n *\n * If variables have already been set, merge the new\n * variables with the old ones.\n */", "return...
Create a flash message @param string $key @param mixed $value @return
[ "Create", "a", "flash", "message" ]
fc5c0f2b582a04de1685578d3fb790686a0a240c
https://github.com/modulusphp/http/blob/fc5c0f2b582a04de1685578d3fb790686a0a240c/Session.php#L56-L68