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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
28,200 | boekkooi/TwigJackBundle | src/Twig/Loader/DoctrineLoader.php | DoctrineLoader.findTemplate | protected function findTemplate($name)
{
if (!$this->isLoadableTemplate($name)) {
throw new \Twig_Error_Loader(sprintf('Malformed namespaced template name "%s" (expecting "%stemplate_name").', $name, $this->prefix));
}
$templateIdentifier = substr($name, strlen($this->prefix));
... | php | protected function findTemplate($name)
{
if (!$this->isLoadableTemplate($name)) {
throw new \Twig_Error_Loader(sprintf('Malformed namespaced template name "%s" (expecting "%stemplate_name").', $name, $this->prefix));
}
$templateIdentifier = substr($name, strlen($this->prefix));
... | [
"protected",
"function",
"findTemplate",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isLoadableTemplate",
"(",
"$",
"name",
")",
")",
"{",
"throw",
"new",
"\\",
"Twig_Error_Loader",
"(",
"sprintf",
"(",
"'Malformed namespaced template name ... | Find a template by it's name
@param string $name The name of the template to find
@return TemplateInterface
@throws \Twig_Error_Loader | [
"Find",
"a",
"template",
"by",
"it",
"s",
"name"
] | 8aa9fe7681eaabe6285aa76d0a52e9da4ff67ffa | https://github.com/boekkooi/TwigJackBundle/blob/8aa9fe7681eaabe6285aa76d0a52e9da4ff67ffa/src/Twig/Loader/DoctrineLoader.php#L112-L133 |
28,201 | peakphp/framework | src/Config/FilesHandlers.php | FilesHandlers.get | public function get(string $name): array
{
if (!$this->has($name)) {
throw new NoFileHandlersException($name);
}
return $this->handlers[$name];
} | php | public function get(string $name): array
{
if (!$this->has($name)) {
throw new NoFileHandlersException($name);
}
return $this->handlers[$name];
} | [
"public",
"function",
"get",
"(",
"string",
"$",
"name",
")",
":",
"array",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"has",
"(",
"$",
"name",
")",
")",
"{",
"throw",
"new",
"NoFileHandlersException",
"(",
"$",
"name",
")",
";",
"}",
"return",
"$",
... | Get a file handlers
@param string $name
@return array
@throws NoFileHandlersException | [
"Get",
"a",
"file",
"handlers"
] | 412c13c2a0f165ee645eb3636f23a74a81429d3a | https://github.com/peakphp/framework/blob/412c13c2a0f165ee645eb3636f23a74a81429d3a/src/Config/FilesHandlers.php#L90-L97 |
28,202 | peakphp/framework | src/Config/FilesHandlers.php | FilesHandlers.set | public function set(string $name, string $loader, string $processor): FilesHandlers
{
$this->handlers[$name] = [
'loader' => new $loader(),
'processor' => new $processor(),
];
return $this;
} | php | public function set(string $name, string $loader, string $processor): FilesHandlers
{
$this->handlers[$name] = [
'loader' => new $loader(),
'processor' => new $processor(),
];
return $this;
} | [
"public",
"function",
"set",
"(",
"string",
"$",
"name",
",",
"string",
"$",
"loader",
",",
"string",
"$",
"processor",
")",
":",
"FilesHandlers",
"{",
"$",
"this",
"->",
"handlers",
"[",
"$",
"name",
"]",
"=",
"[",
"'loader'",
"=>",
"new",
"$",
"loa... | Add or override a file handlers
@param string $name
@param string $loader
@param string $processor
@return FilesHandlers | [
"Add",
"or",
"override",
"a",
"file",
"handlers"
] | 412c13c2a0f165ee645eb3636f23a74a81429d3a | https://github.com/peakphp/framework/blob/412c13c2a0f165ee645eb3636f23a74a81429d3a/src/Config/FilesHandlers.php#L143-L150 |
28,203 | milejko/mmi | src/Mmi/App/BootstrapCli.php | BootstrapCli.run | public function run()
{
$request = new \Mmi\Http\Request;
//ustawianie domyślnego języka jeśli istnieje
if (isset(\App\Registry::$config->languages[0])) {
$request->lang = \App\Registry::$config->languages[0];
}
$request->setModuleName('mmi')
->setCont... | php | public function run()
{
$request = new \Mmi\Http\Request;
//ustawianie domyślnego języka jeśli istnieje
if (isset(\App\Registry::$config->languages[0])) {
$request->lang = \App\Registry::$config->languages[0];
}
$request->setModuleName('mmi')
->setCont... | [
"public",
"function",
"run",
"(",
")",
"{",
"$",
"request",
"=",
"new",
"\\",
"Mmi",
"\\",
"Http",
"\\",
"Request",
";",
"//ustawianie domyślnego języka jeśli istnieje",
"if",
"(",
"isset",
"(",
"\\",
"App",
"\\",
"Registry",
"::",
"$",
"config",
"->",
"la... | Uruchamianie bootstrapa - brak front kontrolera | [
"Uruchamianie",
"bootstrapa",
"-",
"brak",
"front",
"kontrolera"
] | c1e8dddf83665ad3463ff801074aa2b0875db19b | https://github.com/milejko/mmi/blob/c1e8dddf83665ad3463ff801074aa2b0875db19b/src/Mmi/App/BootstrapCli.php#L31-L45 |
28,204 | milejko/mmi | src/Mmi/Security/Auth.php | Auth._setAuthentication | protected function _setAuthentication(\Mmi\Security\AuthRecord $record)
{
//przekazanie danych z rekordu autoryzacji do sesji
$this->_session->setFromArray((array)$record);
return true;
} | php | protected function _setAuthentication(\Mmi\Security\AuthRecord $record)
{
//przekazanie danych z rekordu autoryzacji do sesji
$this->_session->setFromArray((array)$record);
return true;
} | [
"protected",
"function",
"_setAuthentication",
"(",
"\\",
"Mmi",
"\\",
"Security",
"\\",
"AuthRecord",
"$",
"record",
")",
"{",
"//przekazanie danych z rekordu autoryzacji do sesji",
"$",
"this",
"->",
"_session",
"->",
"setFromArray",
"(",
"(",
"array",
")",
"$",
... | Wymuszenie ustawienia autoryzacji
@param \Mmi\Security\AuthRecord $record
@return boolean | [
"Wymuszenie",
"ustawienia",
"autoryzacji"
] | c1e8dddf83665ad3463ff801074aa2b0875db19b | https://github.com/milejko/mmi/blob/c1e8dddf83665ad3463ff801074aa2b0875db19b/src/Mmi/Security/Auth.php#L285-L290 |
28,205 | milejko/mmi | src/Mmi/Security/Auth.php | Auth.httpAuth | public function httpAuth($realm = '', $errorMessage = '')
{
//pobieranie usera i hasła ze zmiennych środowiskowych
$this->setIdentity(\Mmi\App\FrontController::getInstance()->getEnvironment()->authUser)
->setCredential(\Mmi\App\FrontController::getInstance()->getEnvironment()->authPasswo... | php | public function httpAuth($realm = '', $errorMessage = '')
{
//pobieranie usera i hasła ze zmiennych środowiskowych
$this->setIdentity(\Mmi\App\FrontController::getInstance()->getEnvironment()->authUser)
->setCredential(\Mmi\App\FrontController::getInstance()->getEnvironment()->authPasswo... | [
"public",
"function",
"httpAuth",
"(",
"$",
"realm",
"=",
"''",
",",
"$",
"errorMessage",
"=",
"''",
")",
"{",
"//pobieranie usera i hasła ze zmiennych środowiskowych",
"$",
"this",
"->",
"setIdentity",
"(",
"\\",
"Mmi",
"\\",
"App",
"\\",
"FrontController",
"::... | Uwierzytelnienie przez http
@param string $realm identyfikator przestrzeni chronionej
@param string $errorMessage treść komunikatu zwrotnego - błędnego | [
"Uwierzytelnienie",
"przez",
"http"
] | c1e8dddf83665ad3463ff801074aa2b0875db19b | https://github.com/milejko/mmi/blob/c1e8dddf83665ad3463ff801074aa2b0875db19b/src/Mmi/Security/Auth.php#L317-L337 |
28,206 | peakphp/framework | src/Di/BindingResolver.php | BindingResolver.resolve | public function resolve(BindingInterface $binding, Container $container, $args = [], $explicit = null)
{
return $binding->resolve($container, $args, $explicit);
} | php | public function resolve(BindingInterface $binding, Container $container, $args = [], $explicit = null)
{
return $binding->resolve($container, $args, $explicit);
} | [
"public",
"function",
"resolve",
"(",
"BindingInterface",
"$",
"binding",
",",
"Container",
"$",
"container",
",",
"$",
"args",
"=",
"[",
"]",
",",
"$",
"explicit",
"=",
"null",
")",
"{",
"return",
"$",
"binding",
"->",
"resolve",
"(",
"$",
"container",
... | Resolve a binding request
@param BindingInterface $binding
@param Container $container
@param array $args
@param null $explicit
@return mixed | [
"Resolve",
"a",
"binding",
"request"
] | 412c13c2a0f165ee645eb3636f23a74a81429d3a | https://github.com/peakphp/framework/blob/412c13c2a0f165ee645eb3636f23a74a81429d3a/src/Di/BindingResolver.php#L20-L23 |
28,207 | peakphp/framework | src/Bedrock/Bootstrap/BootableResolver.php | BootableResolver.resolve | public function resolve($item): Bootable
{
if(is_string($item) && class_exists($item)) {
if (null !== $this->container) {
$item = $this->container->get($item);
}
if (is_string($item)) {
$item = new $item();
}
} elseif (i... | php | public function resolve($item): Bootable
{
if(is_string($item) && class_exists($item)) {
if (null !== $this->container) {
$item = $this->container->get($item);
}
if (is_string($item)) {
$item = new $item();
}
} elseif (i... | [
"public",
"function",
"resolve",
"(",
"$",
"item",
")",
":",
"Bootable",
"{",
"if",
"(",
"is_string",
"(",
"$",
"item",
")",
"&&",
"class_exists",
"(",
"$",
"item",
")",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"container",
")",
"{",
... | Try to return a resolved item or throw an exception
@param mixed $item
@return Bootable
@throws InvalidBootableProcessException | [
"Try",
"to",
"return",
"a",
"resolved",
"item",
"or",
"throw",
"an",
"exception"
] | 412c13c2a0f165ee645eb3636f23a74a81429d3a | https://github.com/peakphp/framework/blob/412c13c2a0f165ee645eb3636f23a74a81429d3a/src/Bedrock/Bootstrap/BootableResolver.php#L36-L54 |
28,208 | cedx/lcov.php | lib/FunctionData.php | FunctionData.fromJson | static function fromJson(object $map): self {
return new static(
isset($map->functionName) && is_string($map->functionName) ? $map->functionName : '',
isset($map->lineNumber) && is_int($map->lineNumber) ? $map->lineNumber : 0,
isset($map->executionCount) && is_int($map->executionCount) ? $map->exe... | php | static function fromJson(object $map): self {
return new static(
isset($map->functionName) && is_string($map->functionName) ? $map->functionName : '',
isset($map->lineNumber) && is_int($map->lineNumber) ? $map->lineNumber : 0,
isset($map->executionCount) && is_int($map->executionCount) ? $map->exe... | [
"static",
"function",
"fromJson",
"(",
"object",
"$",
"map",
")",
":",
"self",
"{",
"return",
"new",
"static",
"(",
"isset",
"(",
"$",
"map",
"->",
"functionName",
")",
"&&",
"is_string",
"(",
"$",
"map",
"->",
"functionName",
")",
"?",
"$",
"map",
"... | Creates a new function data from the specified JSON map.
@param object $map A JSON map representing a function data.
@return static The instance corresponding to the specified JSON map. | [
"Creates",
"a",
"new",
"function",
"data",
"from",
"the",
"specified",
"JSON",
"map",
"."
] | ae0129ec01f3e77e3598b82971383c334b213afe | https://github.com/cedx/lcov.php/blob/ae0129ec01f3e77e3598b82971383c334b213afe/lib/FunctionData.php#L41-L47 |
28,209 | cedx/lcov.php | lib/FunctionData.php | FunctionData.toString | function toString(bool $asDefinition = false): string {
$token = $asDefinition ? Token::functionName : Token::functionData;
$number = $asDefinition ? $this->getLineNumber() : $this->getExecutionCount();
return "$token:$number,{$this->getFunctionName()}";
} | php | function toString(bool $asDefinition = false): string {
$token = $asDefinition ? Token::functionName : Token::functionData;
$number = $asDefinition ? $this->getLineNumber() : $this->getExecutionCount();
return "$token:$number,{$this->getFunctionName()}";
} | [
"function",
"toString",
"(",
"bool",
"$",
"asDefinition",
"=",
"false",
")",
":",
"string",
"{",
"$",
"token",
"=",
"$",
"asDefinition",
"?",
"Token",
"::",
"functionName",
":",
"Token",
"::",
"functionData",
";",
"$",
"number",
"=",
"$",
"asDefinition",
... | Returns a string representation of this object.
@param bool $asDefinition Value indicating whether to return the function definition (e.g. name and line number) instead of its data (e.g. name and execution count).
@return string The string representation of this object. | [
"Returns",
"a",
"string",
"representation",
"of",
"this",
"object",
"."
] | ae0129ec01f3e77e3598b82971383c334b213afe | https://github.com/cedx/lcov.php/blob/ae0129ec01f3e77e3598b82971383c334b213afe/lib/FunctionData.php#L100-L104 |
28,210 | milejko/mmi | src/Mmi/Db/Deployer.php | Deployer._importIncremental | protected function _importIncremental($file)
{
//nazwa pliku
$baseFileName = basename($file);
//hash pliku
$md5file = md5_file($file);
//ustawianie domyślnych parametrów importu
\App\Registry::$db->setDefaultImportParams();
//pobranie rekordu
try {
... | php | protected function _importIncremental($file)
{
//nazwa pliku
$baseFileName = basename($file);
//hash pliku
$md5file = md5_file($file);
//ustawianie domyślnych parametrów importu
\App\Registry::$db->setDefaultImportParams();
//pobranie rekordu
try {
... | [
"protected",
"function",
"_importIncremental",
"(",
"$",
"file",
")",
"{",
"//nazwa pliku",
"$",
"baseFileName",
"=",
"basename",
"(",
"$",
"file",
")",
";",
"//hash pliku",
"$",
"md5file",
"=",
"md5_file",
"(",
"$",
"file",
")",
";",
"//ustawianie domyślnych ... | Importuje pojedynczy plik
@param string $file
@throws \Mmi\App\KernelException | [
"Importuje",
"pojedynczy",
"plik"
] | c1e8dddf83665ad3463ff801074aa2b0875db19b | https://github.com/milejko/mmi/blob/c1e8dddf83665ad3463ff801074aa2b0875db19b/src/Mmi/Db/Deployer.php#L61-L99 |
28,211 | milejko/mmi | src/Mmi/Db/Deployer.php | Deployer._importSql | protected function _importSql($fileName)
{
//rozbicie zapytań po średniku i końcu linii
foreach (explode(';' . PHP_EOL, file_get_contents($fileName)) as $query) {
//wykonanie zapytania
$this->_performQuery($query);
}
} | php | protected function _importSql($fileName)
{
//rozbicie zapytań po średniku i końcu linii
foreach (explode(';' . PHP_EOL, file_get_contents($fileName)) as $query) {
//wykonanie zapytania
$this->_performQuery($query);
}
} | [
"protected",
"function",
"_importSql",
"(",
"$",
"fileName",
")",
"{",
"//rozbicie zapytań po średniku i końcu linii",
"foreach",
"(",
"explode",
"(",
"';'",
".",
"PHP_EOL",
",",
"file_get_contents",
"(",
"$",
"fileName",
")",
")",
"as",
"$",
"query",
")",
"{",
... | Import pliku sql
@param string $fileName nazwa pliku | [
"Import",
"pliku",
"sql"
] | c1e8dddf83665ad3463ff801074aa2b0875db19b | https://github.com/milejko/mmi/blob/c1e8dddf83665ad3463ff801074aa2b0875db19b/src/Mmi/Db/Deployer.php#L105-L112 |
28,212 | milejko/mmi | src/Mmi/Db/Deployer.php | Deployer._performQuery | protected function _performQuery($query)
{
//brak query
if (!trim($query)) {
return;
}
//start transakcji
\App\Registry::$db->beginTransaction();
//quera jeśli błędna rollback i die, jeśli poprawna commit
try {
//wykonanie zapytania
... | php | protected function _performQuery($query)
{
//brak query
if (!trim($query)) {
return;
}
//start transakcji
\App\Registry::$db->beginTransaction();
//quera jeśli błędna rollback i die, jeśli poprawna commit
try {
//wykonanie zapytania
... | [
"protected",
"function",
"_performQuery",
"(",
"$",
"query",
")",
"{",
"//brak query",
"if",
"(",
"!",
"trim",
"(",
"$",
"query",
")",
")",
"{",
"return",
";",
"}",
"//start transakcji",
"\\",
"App",
"\\",
"Registry",
"::",
"$",
"db",
"->",
"beginTransac... | Wykonanie pojedynczego zapytania
@param string $query | [
"Wykonanie",
"pojedynczego",
"zapytania"
] | c1e8dddf83665ad3463ff801074aa2b0875db19b | https://github.com/milejko/mmi/blob/c1e8dddf83665ad3463ff801074aa2b0875db19b/src/Mmi/Db/Deployer.php#L118-L137 |
28,213 | milejko/mmi | src/Mmi/App/ComposerInstaller.php | ComposerInstaller._copyDistFiles | protected static function _copyDistFiles()
{
//iteracja po wymaganych plikach
foreach (self::$_distFiles as $src => $dest) {
//kalkulacja ścieżki
$source = BASE_PATH . $src;
//brak pliku
if (!file_exists($source)) {
continue;
... | php | protected static function _copyDistFiles()
{
//iteracja po wymaganych plikach
foreach (self::$_distFiles as $src => $dest) {
//kalkulacja ścieżki
$source = BASE_PATH . $src;
//brak pliku
if (!file_exists($source)) {
continue;
... | [
"protected",
"static",
"function",
"_copyDistFiles",
"(",
")",
"{",
"//iteracja po wymaganych plikach ",
"foreach",
"(",
"self",
"::",
"$",
"_distFiles",
"as",
"$",
"src",
"=>",
"$",
"dest",
")",
"{",
"//kalkulacja ścieżki ",
"$",
"source",
"=",
"BASE_PATH",
"."... | Kopiuje pliki z dystrybucji | [
"Kopiuje",
"pliki",
"z",
"dystrybucji"
] | c1e8dddf83665ad3463ff801074aa2b0875db19b | https://github.com/milejko/mmi/blob/c1e8dddf83665ad3463ff801074aa2b0875db19b/src/Mmi/App/ComposerInstaller.php#L98-L115 |
28,214 | honeybee/honeybee | src/Infrastructure/DataAccess/Connector/StatusReport.php | StatusReport.generate | public static function generate(ConnectorMap $connector_map)
{
$details = [];
$failing = 0;
$working = 0;
$unknown = 0;
$connections = [];
foreach ($connector_map as $name => $connector) {
try {
$connections[$name] = $connector->getStatus(... | php | public static function generate(ConnectorMap $connector_map)
{
$details = [];
$failing = 0;
$working = 0;
$unknown = 0;
$connections = [];
foreach ($connector_map as $name => $connector) {
try {
$connections[$name] = $connector->getStatus(... | [
"public",
"static",
"function",
"generate",
"(",
"ConnectorMap",
"$",
"connector_map",
")",
"{",
"$",
"details",
"=",
"[",
"]",
";",
"$",
"failing",
"=",
"0",
";",
"$",
"working",
"=",
"0",
";",
"$",
"unknown",
"=",
"0",
";",
"$",
"connections",
"=",... | Generates a new StatusReport by getting the Status from all known connections.
@todo Should only specific exceptions be catched when getStatus() is called on the connectors? Rethrow?
@param ConnectorMap $connector_map
@return StatusReport | [
"Generates",
"a",
"new",
"StatusReport",
"by",
"getting",
"the",
"Status",
"from",
"all",
"known",
"connections",
"."
] | 6e46b4f20a0b8a3ce686565440f739960e325a05 | https://github.com/honeybee/honeybee/blob/6e46b4f20a0b8a3ce686565440f739960e325a05/src/Infrastructure/DataAccess/Connector/StatusReport.php#L42-L93 |
28,215 | milejko/mmi | src/Mmi/Cache/FileHandler.php | FileHandler._deleteNoBroadcasting | protected function _deleteNoBroadcasting($key)
{
//próba usunięcia pliku
try {
unlink($this->_cache->getConfig()->path . '/' . $key);
} catch (\Exception $e) {
//nic
}
return true;
} | php | protected function _deleteNoBroadcasting($key)
{
//próba usunięcia pliku
try {
unlink($this->_cache->getConfig()->path . '/' . $key);
} catch (\Exception $e) {
//nic
}
return true;
} | [
"protected",
"function",
"_deleteNoBroadcasting",
"(",
"$",
"key",
")",
"{",
"//próba usunięcia pliku",
"try",
"{",
"unlink",
"(",
"$",
"this",
"->",
"_cache",
"->",
"getConfig",
"(",
")",
"->",
"path",
".",
"'/'",
".",
"$",
"key",
")",
";",
"}",
"catch"... | Kasuje dane o podanym kluczu
@param string $key klucz
@return boolean | [
"Kasuje",
"dane",
"o",
"podanym",
"kluczu"
] | c1e8dddf83665ad3463ff801074aa2b0875db19b | https://github.com/milejko/mmi/blob/c1e8dddf83665ad3463ff801074aa2b0875db19b/src/Mmi/Cache/FileHandler.php#L54-L63 |
28,216 | peakphp/framework | src/Common/ClassFinder.php | ClassFinder.findFirst | public function findFirst(string $basename): ?string
{
$basename = $this->getClassName($basename);
foreach ($this->namespaces as $ns) {
if (class_exists($ns.'\\'.$basename)) {
return $ns.'\\'.$basename;
}
}
return null;
} | php | public function findFirst(string $basename): ?string
{
$basename = $this->getClassName($basename);
foreach ($this->namespaces as $ns) {
if (class_exists($ns.'\\'.$basename)) {
return $ns.'\\'.$basename;
}
}
return null;
} | [
"public",
"function",
"findFirst",
"(",
"string",
"$",
"basename",
")",
":",
"?",
"string",
"{",
"$",
"basename",
"=",
"$",
"this",
"->",
"getClassName",
"(",
"$",
"basename",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"namespaces",
"as",
"$",
"ns",
... | Return the first class name found or false
@param string $basename
@return string|null | [
"Return",
"the",
"first",
"class",
"name",
"found",
"or",
"false"
] | 412c13c2a0f165ee645eb3636f23a74a81429d3a | https://github.com/peakphp/framework/blob/412c13c2a0f165ee645eb3636f23a74a81429d3a/src/Common/ClassFinder.php#L67-L76 |
28,217 | milejko/mmi | src/Mmi/FileSystem.php | FileSystem.unlinkRecursive | public static function unlinkRecursive($fileName, $rootName)
{
//brak katalogu głównego
if (!file_exists($rootName)) {
return false;
}
//iteracja po katalogu głównym
foreach (new \DirectoryIterator($rootName) as $file) {
//katalog .
if ($fi... | php | public static function unlinkRecursive($fileName, $rootName)
{
//brak katalogu głównego
if (!file_exists($rootName)) {
return false;
}
//iteracja po katalogu głównym
foreach (new \DirectoryIterator($rootName) as $file) {
//katalog .
if ($fi... | [
"public",
"static",
"function",
"unlinkRecursive",
"(",
"$",
"fileName",
",",
"$",
"rootName",
")",
"{",
"//brak katalogu głównego",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"rootName",
")",
")",
"{",
"return",
"false",
";",
"}",
"//iteracja po katalogu głównym"... | Kasuje pliki rekurencyjnie
@param string $fileName nazwa pliku
@param string $rootName katalog główny
@return boolean | [
"Kasuje",
"pliki",
"rekurencyjnie"
] | c1e8dddf83665ad3463ff801074aa2b0875db19b | https://github.com/milejko/mmi/blob/c1e8dddf83665ad3463ff801074aa2b0875db19b/src/Mmi/FileSystem.php#L62-L92 |
28,218 | milejko/mmi | src/Mmi/FileSystem.php | FileSystem.rmdirRecursive | public static function rmdirRecursive($dirName)
{
//próba zbadania czy jest plikiem
try {
$isFile = is_file($dirName);
} catch (\Exception $e) {
return false;
}
//zwykły plik
if ($isFile) {
//próba usunięcia
try {
... | php | public static function rmdirRecursive($dirName)
{
//próba zbadania czy jest plikiem
try {
$isFile = is_file($dirName);
} catch (\Exception $e) {
return false;
}
//zwykły plik
if ($isFile) {
//próba usunięcia
try {
... | [
"public",
"static",
"function",
"rmdirRecursive",
"(",
"$",
"dirName",
")",
"{",
"//próba zbadania czy jest plikiem",
"try",
"{",
"$",
"isFile",
"=",
"is_file",
"(",
"$",
"dirName",
")",
";",
"}",
"catch",
"(",
"\\",
"Exception",
"$",
"e",
")",
"{",
"retur... | Usuwa katalog rekurencyjnie
@param string $dirName nazwa katalogu
@return boolean | [
"Usuwa",
"katalog",
"rekurencyjnie"
] | c1e8dddf83665ad3463ff801074aa2b0875db19b | https://github.com/milejko/mmi/blob/c1e8dddf83665ad3463ff801074aa2b0875db19b/src/Mmi/FileSystem.php#L99-L142 |
28,219 | peakphp/framework | src/Di/Container.php | Container.create | public function create(string $class, $args = [], $explicit = null)
{
// check first for definition even if auto wiring is on
$def = $this->getDefinition($class);
if ($def === null && !$this->auto_wiring) {
throw new ClassDefinitionNotFoundException($class);
} elseif ($de... | php | public function create(string $class, $args = [], $explicit = null)
{
// check first for definition even if auto wiring is on
$def = $this->getDefinition($class);
if ($def === null && !$this->auto_wiring) {
throw new ClassDefinitionNotFoundException($class);
} elseif ($de... | [
"public",
"function",
"create",
"(",
"string",
"$",
"class",
",",
"$",
"args",
"=",
"[",
"]",
",",
"$",
"explicit",
"=",
"null",
")",
"{",
"// check first for definition even if auto wiring is on",
"$",
"def",
"=",
"$",
"this",
"->",
"getDefinition",
"(",
"$... | Instantiate a class
The generated instance is not stored, but may use stored
instance(s) as dependency when needed
@param string $class
@param array $args
@param null $explicit
@return mixed|object
@throws ClassDefinitionNotFoundException
@throws Exception\AmbiguousResolutionException
@throws Exception\InterfaceNotFo... | [
"Instantiate",
"a",
"class"
] | 412c13c2a0f165ee645eb3636f23a74a81429d3a | https://github.com/peakphp/framework/blob/412c13c2a0f165ee645eb3636f23a74a81429d3a/src/Di/Container.php#L95-L115 |
28,220 | peakphp/framework | src/Di/Container.php | Container.resolve | public function resolve(string $definition, array $args = [])
{
$def = $this->getDefinition($definition);
if ($def === null) {
throw new ClassDefinitionNotFoundException($definition);
}
return $this->binding_resolver->resolve($def, $this, $args);
} | php | public function resolve(string $definition, array $args = [])
{
$def = $this->getDefinition($definition);
if ($def === null) {
throw new ClassDefinitionNotFoundException($definition);
}
return $this->binding_resolver->resolve($def, $this, $args);
} | [
"public",
"function",
"resolve",
"(",
"string",
"$",
"definition",
",",
"array",
"$",
"args",
"=",
"[",
"]",
")",
"{",
"$",
"def",
"=",
"$",
"this",
"->",
"getDefinition",
"(",
"$",
"definition",
")",
";",
"if",
"(",
"$",
"def",
"===",
"null",
")",... | Resolve a stored definition
@param string $definition
@param array $args
@return mixed
@throws ClassDefinitionNotFoundException | [
"Resolve",
"a",
"stored",
"definition"
] | 412c13c2a0f165ee645eb3636f23a74a81429d3a | https://github.com/peakphp/framework/blob/412c13c2a0f165ee645eb3636f23a74a81429d3a/src/Di/Container.php#L164-L172 |
28,221 | peakphp/framework | src/Di/Container.php | Container.get | public function get($id)
{
if ($this->has($id)) {
return $this->instances[$id];
} elseif ($this->hasAlias($id) && $this->has($this->aliases[$id])) {
return $this->instances[$this->aliases[$id]];
}
return $this->create($id);
} | php | public function get($id)
{
if ($this->has($id)) {
return $this->instances[$id];
} elseif ($this->hasAlias($id) && $this->has($this->aliases[$id])) {
return $this->instances[$this->aliases[$id]];
}
return $this->create($id);
} | [
"public",
"function",
"get",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"has",
"(",
"$",
"id",
")",
")",
"{",
"return",
"$",
"this",
"->",
"instances",
"[",
"$",
"id",
"]",
";",
"}",
"elseif",
"(",
"$",
"this",
"->",
"hasAlias",
... | Get an instance if exists, otherwise try to create it return null
@param string $id
@return mixed|object
@throws ClassDefinitionNotFoundException
@throws Exception\AmbiguousResolutionException
@throws Exception\InterfaceNotFoundException
@throws \ReflectionException | [
"Get",
"an",
"instance",
"if",
"exists",
"otherwise",
"try",
"to",
"create",
"it",
"return",
"null"
] | 412c13c2a0f165ee645eb3636f23a74a81429d3a | https://github.com/peakphp/framework/blob/412c13c2a0f165ee645eb3636f23a74a81429d3a/src/Di/Container.php#L195-L204 |
28,222 | peakphp/framework | src/Di/Container.php | Container.set | public function set(object $object, string $alias = null)
{
$class = get_class($object);
$this->instances[$class] = $object;
if (isset($alias)) {
$this->addAlias($alias, $class);
}
$interfaces = class_implements($object);
if (is_array($interfaces)) {
... | php | public function set(object $object, string $alias = null)
{
$class = get_class($object);
$this->instances[$class] = $object;
if (isset($alias)) {
$this->addAlias($alias, $class);
}
$interfaces = class_implements($object);
if (is_array($interfaces)) {
... | [
"public",
"function",
"set",
"(",
"object",
"$",
"object",
",",
"string",
"$",
"alias",
"=",
"null",
")",
"{",
"$",
"class",
"=",
"get_class",
"(",
"$",
"object",
")",
";",
"$",
"this",
"->",
"instances",
"[",
"$",
"class",
"]",
"=",
"$",
"object",... | Set an object instance. Chainable
@param object $object
@param string|null $alias
@return Container | [
"Set",
"an",
"object",
"instance",
".",
"Chainable"
] | 412c13c2a0f165ee645eb3636f23a74a81429d3a | https://github.com/peakphp/framework/blob/412c13c2a0f165ee645eb3636f23a74a81429d3a/src/Di/Container.php#L213-L230 |
28,223 | peakphp/framework | src/Di/Container.php | Container.delete | public function delete($id)
{
if ($this->has($id)) {
//remove instance
unset($this->instances[$id]);
//remove interface reference if exists
foreach ($this->interfaces as $int => $classes) {
$key = array_search($id, $classes);
i... | php | public function delete($id)
{
if ($this->has($id)) {
//remove instance
unset($this->instances[$id]);
//remove interface reference if exists
foreach ($this->interfaces as $int => $classes) {
$key = array_search($id, $classes);
i... | [
"public",
"function",
"delete",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"has",
"(",
"$",
"id",
")",
")",
"{",
"//remove instance",
"unset",
"(",
"$",
"this",
"->",
"instances",
"[",
"$",
"id",
"]",
")",
";",
"//remove interface refere... | Delete an instance if exists.
@param string $id
@return Container | [
"Delete",
"an",
"instance",
"if",
"exists",
"."
] | 412c13c2a0f165ee645eb3636f23a74a81429d3a | https://github.com/peakphp/framework/blob/412c13c2a0f165ee645eb3636f23a74a81429d3a/src/Di/Container.php#L238-L262 |
28,224 | peakphp/framework | src/Di/Container.php | Container.addAlias | public function addAlias(string $name, string $className)
{
$this->aliases[$name] = $className;
return $this;
} | php | public function addAlias(string $name, string $className)
{
$this->aliases[$name] = $className;
return $this;
} | [
"public",
"function",
"addAlias",
"(",
"string",
"$",
"name",
",",
"string",
"$",
"className",
")",
"{",
"$",
"this",
"->",
"aliases",
"[",
"$",
"name",
"]",
"=",
"$",
"className",
";",
"return",
"$",
"this",
";",
"}"
] | Add a class alias
@param string $name
@param string $className
@return $this | [
"Add",
"a",
"class",
"alias"
] | 412c13c2a0f165ee645eb3636f23a74a81429d3a | https://github.com/peakphp/framework/blob/412c13c2a0f165ee645eb3636f23a74a81429d3a/src/Di/Container.php#L271-L275 |
28,225 | peakphp/framework | src/Di/Container.php | Container.addInterface | protected function addInterface(string $name, string $class)
{
if (!$this->hasInterface($name)) {
$this->interfaces[$name] = $class;
return;
}
$interfaces = $this->getInterface($name);
if (!is_array($interfaces)) {
$interfaces = [$interfaces];
... | php | protected function addInterface(string $name, string $class)
{
if (!$this->hasInterface($name)) {
$this->interfaces[$name] = $class;
return;
}
$interfaces = $this->getInterface($name);
if (!is_array($interfaces)) {
$interfaces = [$interfaces];
... | [
"protected",
"function",
"addInterface",
"(",
"string",
"$",
"name",
",",
"string",
"$",
"class",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasInterface",
"(",
"$",
"name",
")",
")",
"{",
"$",
"this",
"->",
"interfaces",
"[",
"$",
"name",
"]",
... | Catalogue also class interface when using add
@param string $name
@param string $class | [
"Catalogue",
"also",
"class",
"interface",
"when",
"using",
"add"
] | 412c13c2a0f165ee645eb3636f23a74a81429d3a | https://github.com/peakphp/framework/blob/412c13c2a0f165ee645eb3636f23a74a81429d3a/src/Di/Container.php#L314-L330 |
28,226 | peakphp/framework | src/Di/Container.php | Container.getInterface | public function getInterface(string $name)
{
if ($this->hasInterface($name)) {
return $this->interfaces[$name];
}
return null;
} | php | public function getInterface(string $name)
{
if ($this->hasInterface($name)) {
return $this->interfaces[$name];
}
return null;
} | [
"public",
"function",
"getInterface",
"(",
"string",
"$",
"name",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasInterface",
"(",
"$",
"name",
")",
")",
"{",
"return",
"$",
"this",
"->",
"interfaces",
"[",
"$",
"name",
"]",
";",
"}",
"return",
"null",
... | Get an interface
@param string $name
@return mixed|null | [
"Get",
"an",
"interface"
] | 412c13c2a0f165ee645eb3636f23a74a81429d3a | https://github.com/peakphp/framework/blob/412c13c2a0f165ee645eb3636f23a74a81429d3a/src/Di/Container.php#L349-L355 |
28,227 | peakphp/framework | src/Di/Container.php | Container.getDefinition | public function getDefinition(string $name)
{
if ($this->hasDefinition($name)) {
return $this->definitions[$name];
}
return null;
} | php | public function getDefinition(string $name)
{
if ($this->hasDefinition($name)) {
return $this->definitions[$name];
}
return null;
} | [
"public",
"function",
"getDefinition",
"(",
"string",
"$",
"name",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasDefinition",
"(",
"$",
"name",
")",
")",
"{",
"return",
"$",
"this",
"->",
"definitions",
"[",
"$",
"name",
"]",
";",
"}",
"return",
"null"... | Get a definition
@param string $name
@return mixed | [
"Get",
"a",
"definition"
] | 412c13c2a0f165ee645eb3636f23a74a81429d3a | https://github.com/peakphp/framework/blob/412c13c2a0f165ee645eb3636f23a74a81429d3a/src/Di/Container.php#L409-L415 |
28,228 | peakphp/framework | src/Di/Container.php | Container.bind | public function bind(string $name, $definition)
{
$this->definitions[$name] = new Singleton($name, $definition);
return $this;
} | php | public function bind(string $name, $definition)
{
$this->definitions[$name] = new Singleton($name, $definition);
return $this;
} | [
"public",
"function",
"bind",
"(",
"string",
"$",
"name",
",",
"$",
"definition",
")",
"{",
"$",
"this",
"->",
"definitions",
"[",
"$",
"name",
"]",
"=",
"new",
"Singleton",
"(",
"$",
"name",
",",
"$",
"definition",
")",
";",
"return",
"$",
"this",
... | Add a singleton definition
@param string $name
@param mixed $definition
@return $this | [
"Add",
"a",
"singleton",
"definition"
] | 412c13c2a0f165ee645eb3636f23a74a81429d3a | https://github.com/peakphp/framework/blob/412c13c2a0f165ee645eb3636f23a74a81429d3a/src/Di/Container.php#L432-L436 |
28,229 | peakphp/framework | src/Di/Container.php | Container.bindPrototype | public function bindPrototype(string $name, $definition)
{
$this->definitions[$name] = new Prototype($name, $definition);
return $this;
} | php | public function bindPrototype(string $name, $definition)
{
$this->definitions[$name] = new Prototype($name, $definition);
return $this;
} | [
"public",
"function",
"bindPrototype",
"(",
"string",
"$",
"name",
",",
"$",
"definition",
")",
"{",
"$",
"this",
"->",
"definitions",
"[",
"$",
"name",
"]",
"=",
"new",
"Prototype",
"(",
"$",
"name",
",",
"$",
"definition",
")",
";",
"return",
"$",
... | Add a prototype definition
@param string $name
@param mixed $definition
@return $this | [
"Add",
"a",
"prototype",
"definition"
] | 412c13c2a0f165ee645eb3636f23a74a81429d3a | https://github.com/peakphp/framework/blob/412c13c2a0f165ee645eb3636f23a74a81429d3a/src/Di/Container.php#L445-L449 |
28,230 | peakphp/framework | src/Di/Container.php | Container.bindFactory | public function bindFactory(string $name, $definition)
{
$this->definitions[$name] = new Factory($name, $definition);
return $this;
} | php | public function bindFactory(string $name, $definition)
{
$this->definitions[$name] = new Factory($name, $definition);
return $this;
} | [
"public",
"function",
"bindFactory",
"(",
"string",
"$",
"name",
",",
"$",
"definition",
")",
"{",
"$",
"this",
"->",
"definitions",
"[",
"$",
"name",
"]",
"=",
"new",
"Factory",
"(",
"$",
"name",
",",
"$",
"definition",
")",
";",
"return",
"$",
"thi... | Add a factory definition
@param string $name
@param mixed $definition
@return $this | [
"Add",
"a",
"factory",
"definition"
] | 412c13c2a0f165ee645eb3636f23a74a81429d3a | https://github.com/peakphp/framework/blob/412c13c2a0f165ee645eb3636f23a74a81429d3a/src/Di/Container.php#L458-L462 |
28,231 | ScriptFUSION/Mapper | src/Mapper.php | Mapper.map | public function map(array $record, $expression, $context = null, $key = null)
{
// Null or scalar values.
if (null === $expression || is_scalar($expression)) {
return $expression;
}
// Strategy.
if ($expression instanceof Strategy) {
return $this->map... | php | public function map(array $record, $expression, $context = null, $key = null)
{
// Null or scalar values.
if (null === $expression || is_scalar($expression)) {
return $expression;
}
// Strategy.
if ($expression instanceof Strategy) {
return $this->map... | [
"public",
"function",
"map",
"(",
"array",
"$",
"record",
",",
"$",
"expression",
",",
"$",
"context",
"=",
"null",
",",
"$",
"key",
"=",
"null",
")",
"{",
"// Null or scalar values.",
"if",
"(",
"null",
"===",
"$",
"expression",
"||",
"is_scalar",
"(",
... | Maps the specified record according to the specified expression type. Optionally, used-defined contextual data
may be passed to the expression. The record key is for internal use only and represents the current array key.
May be called recursively if the expression embeds more expressions.
@param array $record Record... | [
"Maps",
"the",
"specified",
"record",
"according",
"to",
"the",
"specified",
"expression",
"type",
".",
"Optionally",
"used",
"-",
"defined",
"contextual",
"data",
"may",
"be",
"passed",
"to",
"the",
"expression",
".",
"The",
"record",
"key",
"is",
"for",
"i... | 1b8326e238876db9e5f86533ef924f003316a433 | https://github.com/ScriptFUSION/Mapper/blob/1b8326e238876db9e5f86533ef924f003316a433/src/Mapper.php#L26-L49 |
28,232 | quazardous/ImageStack | src/ImageStack/ImageBackend/CacheImageBackend.php | CacheImageBackend.getCacheId | protected function getCacheId(ImagePathInterface $path) {
if ($cid = $this->getOption('cache_prefix')) {
$cid .= DIRECTORY_SEPARATOR;
}
$cid .= $path->getPath();
if ($sanitizer = $this->getOption('cache_id_sanitizer')) {
$cid = call_user_func($sanitizer, $cid);
... | php | protected function getCacheId(ImagePathInterface $path) {
if ($cid = $this->getOption('cache_prefix')) {
$cid .= DIRECTORY_SEPARATOR;
}
$cid .= $path->getPath();
if ($sanitizer = $this->getOption('cache_id_sanitizer')) {
$cid = call_user_func($sanitizer, $cid);
... | [
"protected",
"function",
"getCacheId",
"(",
"ImagePathInterface",
"$",
"path",
")",
"{",
"if",
"(",
"$",
"cid",
"=",
"$",
"this",
"->",
"getOption",
"(",
"'cache_prefix'",
")",
")",
"{",
"$",
"cid",
".=",
"DIRECTORY_SEPARATOR",
";",
"}",
"$",
"cid",
".="... | Get the cache ID from the path and can do sanitize stuff.
@param ImagePathInterface $path
@return string | [
"Get",
"the",
"cache",
"ID",
"from",
"the",
"path",
"and",
"can",
"do",
"sanitize",
"stuff",
"."
] | bca5632edfc7703300407984bbaefb3c91c1560c | https://github.com/quazardous/ImageStack/blob/bca5632edfc7703300407984bbaefb3c91c1560c/src/ImageStack/ImageBackend/CacheImageBackend.php#L50-L59 |
28,233 | quazardous/ImageStack | src/ImageStack/OptionnableTrait.php | OptionnableTrait.setOptions | public function setOptions(array $options, $merge = true)
{
if ($merge) {
$this->options = array_replace($this->options, $options);
} else {
$this->options = $options;
}
} | php | public function setOptions(array $options, $merge = true)
{
if ($merge) {
$this->options = array_replace($this->options, $options);
} else {
$this->options = $options;
}
} | [
"public",
"function",
"setOptions",
"(",
"array",
"$",
"options",
",",
"$",
"merge",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"merge",
")",
"{",
"$",
"this",
"->",
"options",
"=",
"array_replace",
"(",
"$",
"this",
"->",
"options",
",",
"$",
"options",... | Set all options.
@param array $options | [
"Set",
"all",
"options",
"."
] | bca5632edfc7703300407984bbaefb3c91c1560c | https://github.com/quazardous/ImageStack/blob/bca5632edfc7703300407984bbaefb3c91c1560c/src/ImageStack/OptionnableTrait.php#L15-L22 |
28,234 | quazardous/ImageStack | src/ImageStack/OptionnableTrait.php | OptionnableTrait.getOption | public function getOption($name, $default = null)
{
if (!isset($this->options[$name])) {
if (is_callable($default)) {
$default = call_user_func($default);
} if ($default instanceof \Exception) {
throw $default;
}
return $default... | php | public function getOption($name, $default = null)
{
if (!isset($this->options[$name])) {
if (is_callable($default)) {
$default = call_user_func($default);
} if ($default instanceof \Exception) {
throw $default;
}
return $default... | [
"public",
"function",
"getOption",
"(",
"$",
"name",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"options",
"[",
"$",
"name",
"]",
")",
")",
"{",
"if",
"(",
"is_callable",
"(",
"$",
"default",
")",... | Get option value or default or throws exception.
@param string $name
@param mixed|callable|\Exception $default
@throws \Exception
@return mixed | [
"Get",
"option",
"value",
"or",
"default",
"or",
"throws",
"exception",
"."
] | bca5632edfc7703300407984bbaefb3c91c1560c | https://github.com/quazardous/ImageStack/blob/bca5632edfc7703300407984bbaefb3c91c1560c/src/ImageStack/OptionnableTrait.php#L50-L61 |
28,235 | CVO-Technologies/cakephp-gearman | src/JobAwareTrait.php | JobAwareTrait.gearmanClient | public function gearmanClient()
{
$client = new GearmanClient();
$servers = static::_getGearmanServers();
$client->addServers(implode(',', $servers));
return $client;
} | php | public function gearmanClient()
{
$client = new GearmanClient();
$servers = static::_getGearmanServers();
$client->addServers(implode(',', $servers));
return $client;
} | [
"public",
"function",
"gearmanClient",
"(",
")",
"{",
"$",
"client",
"=",
"new",
"GearmanClient",
"(",
")",
";",
"$",
"servers",
"=",
"static",
"::",
"_getGearmanServers",
"(",
")",
";",
"$",
"client",
"->",
"addServers",
"(",
"implode",
"(",
"','",
",",... | Setup a GearmanClient object configured
with the servers from the configuration.
@return GearmanClient | [
"Setup",
"a",
"GearmanClient",
"object",
"configured",
"with",
"the",
"servers",
"from",
"the",
"configuration",
"."
] | 538f060a617165482159c4f5f42d4b0562a14194 | https://github.com/CVO-Technologies/cakephp-gearman/blob/538f060a617165482159c4f5f42d4b0562a14194/src/JobAwareTrait.php#L17-L26 |
28,236 | CVO-Technologies/cakephp-gearman | src/JobAwareTrait.php | JobAwareTrait.gearmanWorker | public function gearmanWorker()
{
$client = new GearmanWorker();
$servers = static::_getGearmanServers();
$client->addServers(implode(',', $servers));
return $client;
} | php | public function gearmanWorker()
{
$client = new GearmanWorker();
$servers = static::_getGearmanServers();
$client->addServers(implode(',', $servers));
return $client;
} | [
"public",
"function",
"gearmanWorker",
"(",
")",
"{",
"$",
"client",
"=",
"new",
"GearmanWorker",
"(",
")",
";",
"$",
"servers",
"=",
"static",
"::",
"_getGearmanServers",
"(",
")",
";",
"$",
"client",
"->",
"addServers",
"(",
"implode",
"(",
"','",
",",... | Setup a GearmanWorker object configured
with the servers from the configuration.
@return GearmanWorker | [
"Setup",
"a",
"GearmanWorker",
"object",
"configured",
"with",
"the",
"servers",
"from",
"the",
"configuration",
"."
] | 538f060a617165482159c4f5f42d4b0562a14194 | https://github.com/CVO-Technologies/cakephp-gearman/blob/538f060a617165482159c4f5f42d4b0562a14194/src/JobAwareTrait.php#L34-L43 |
28,237 | CVO-Technologies/cakephp-gearman | src/JobAwareTrait.php | JobAwareTrait.execute | public function execute($name, $workload, $background = true, $priority = Gearman::PRIORITY_NORMAL)
{
$func = 'do';
switch ($priority) {
case Gearman::PRIORITY_LOW:
$func .= 'Low';
break;
case Gearman::PRIORITY_HIGH:
$func .= 'H... | php | public function execute($name, $workload, $background = true, $priority = Gearman::PRIORITY_NORMAL)
{
$func = 'do';
switch ($priority) {
case Gearman::PRIORITY_LOW:
$func .= 'Low';
break;
case Gearman::PRIORITY_HIGH:
$func .= 'H... | [
"public",
"function",
"execute",
"(",
"$",
"name",
",",
"$",
"workload",
",",
"$",
"background",
"=",
"true",
",",
"$",
"priority",
"=",
"Gearman",
"::",
"PRIORITY_NORMAL",
")",
"{",
"$",
"func",
"=",
"'do'",
";",
"switch",
"(",
"$",
"priority",
")",
... | Execute a job by sending it to the
Gearman server using the GearmanClient.
Example for a background job with normal priority:
$this->execute('sleep', ['seconds' => 60]);
Example for a background job with HIGH priority:
$this->execute('sleep', ['seconds' => 60], true, Gearman::PRIORITY_HIGH);
Example for a normal job... | [
"Execute",
"a",
"job",
"by",
"sending",
"it",
"to",
"the",
"Gearman",
"server",
"using",
"the",
"GearmanClient",
"."
] | 538f060a617165482159c4f5f42d4b0562a14194 | https://github.com/CVO-Technologies/cakephp-gearman/blob/538f060a617165482159c4f5f42d4b0562a14194/src/JobAwareTrait.php#L64-L101 |
28,238 | peakphp/framework | src/Di/ClassInspector.php | ClassInspector.inspect | public function inspect($class, $method = '__construct')
{
if (is_string($class) && !class_exists($class)) {
throw new ClassNotFoundException($class);
}
$dependencies = [];
$r = new ReflectionClass($class);
if (!$r->hasMethod($method)) {
if ($method ... | php | public function inspect($class, $method = '__construct')
{
if (is_string($class) && !class_exists($class)) {
throw new ClassNotFoundException($class);
}
$dependencies = [];
$r = new ReflectionClass($class);
if (!$r->hasMethod($method)) {
if ($method ... | [
"public",
"function",
"inspect",
"(",
"$",
"class",
",",
"$",
"method",
"=",
"'__construct'",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"class",
")",
"&&",
"!",
"class_exists",
"(",
"$",
"class",
")",
")",
"{",
"throw",
"new",
"ClassNotFoundException",... | Get class dependencies method.
By default, method is the constructor itself
@param mixed $class
@param string $method
@return array
@throws Exception | [
"Get",
"class",
"dependencies",
"method",
".",
"By",
"default",
"method",
"is",
"the",
"constructor",
"itself"
] | 412c13c2a0f165ee645eb3636f23a74a81429d3a | https://github.com/peakphp/framework/blob/412c13c2a0f165ee645eb3636f23a74a81429d3a/src/Di/ClassInspector.php#L26-L61 |
28,239 | milejko/mmi | src/Mmi/Http/Response.php | Response.setCode | public function setCode($code, $replace = false)
{
//kod nie istnieje
if (!($message = ResponseTypes::getMessageByCode($code))) {
//wyjątek o nieistniejącym kodzie HTTP
throw new HttpException('HTTP code not found');
}
//zapis kodu
$this->_code = $code... | php | public function setCode($code, $replace = false)
{
//kod nie istnieje
if (!($message = ResponseTypes::getMessageByCode($code))) {
//wyjątek o nieistniejącym kodzie HTTP
throw new HttpException('HTTP code not found');
}
//zapis kodu
$this->_code = $code... | [
"public",
"function",
"setCode",
"(",
"$",
"code",
",",
"$",
"replace",
"=",
"false",
")",
"{",
"//kod nie istnieje",
"if",
"(",
"!",
"(",
"$",
"message",
"=",
"ResponseTypes",
"::",
"getMessageByCode",
"(",
"$",
"code",
")",
")",
")",
"{",
"//wyjątek o ... | Ustawia kod odpowiedzi
@param int $code kod
@param boolean $replace zastąpienie
@return \Mmi\Http\Response | [
"Ustawia",
"kod",
"odpowiedzi"
] | c1e8dddf83665ad3463ff801074aa2b0875db19b | https://github.com/milejko/mmi/blob/c1e8dddf83665ad3463ff801074aa2b0875db19b/src/Mmi/Http/Response.php#L96-L107 |
28,240 | milejko/mmi | src/Mmi/Http/Response.php | Response.setType | public function setType($type, $replace = false)
{
//usuwanie typu odpowiedzi
$this->_type = ResponseTypes::searchType($type);
//wysłanie nagłówka
return $this->setHeader('Content-type', $this->_type, $replace);
} | php | public function setType($type, $replace = false)
{
//usuwanie typu odpowiedzi
$this->_type = ResponseTypes::searchType($type);
//wysłanie nagłówka
return $this->setHeader('Content-type', $this->_type, $replace);
} | [
"public",
"function",
"setType",
"(",
"$",
"type",
",",
"$",
"replace",
"=",
"false",
")",
"{",
"//usuwanie typu odpowiedzi",
"$",
"this",
"->",
"_type",
"=",
"ResponseTypes",
"::",
"searchType",
"(",
"$",
"type",
")",
";",
"//wysłanie nagłówka",
"return",
"... | Ustawia typ kontentu odpowiedzi (content-type
@param string $type nazwa typu np. jpg, gif, html, lub text/html
@param boolean $replace zastąpienie
@return \Mmi\Http\Response | [
"Ustawia",
"typ",
"kontentu",
"odpowiedzi",
"(",
"content",
"-",
"type"
] | c1e8dddf83665ad3463ff801074aa2b0875db19b | https://github.com/milejko/mmi/blob/c1e8dddf83665ad3463ff801074aa2b0875db19b/src/Mmi/Http/Response.php#L170-L176 |
28,241 | peakphp/framework | src/Bedrock/AbstractApplication.php | AbstractApplication.bootstrap | public function bootstrap(array $processes)
{
$bootstrap = new Bootstrap($processes, $this->getContainer());
$bootstrap->boot();
return $this;
} | php | public function bootstrap(array $processes)
{
$bootstrap = new Bootstrap($processes, $this->getContainer());
$bootstrap->boot();
return $this;
} | [
"public",
"function",
"bootstrap",
"(",
"array",
"$",
"processes",
")",
"{",
"$",
"bootstrap",
"=",
"new",
"Bootstrap",
"(",
"$",
"processes",
",",
"$",
"this",
"->",
"getContainer",
"(",
")",
")",
";",
"$",
"bootstrap",
"->",
"boot",
"(",
")",
";",
... | Bootstrap bootable processes
@param array $processes
@return $this
@throws \Peak\Bedrock\Bootstrap\Exception\InvalidBootableProcessException
@throws \ReflectionException | [
"Bootstrap",
"bootable",
"processes"
] | 412c13c2a0f165ee645eb3636f23a74a81429d3a | https://github.com/peakphp/framework/blob/412c13c2a0f165ee645eb3636f23a74a81429d3a/src/Bedrock/AbstractApplication.php#L83-L88 |
28,242 | milejko/mmi | src/Mmi/Paginator/Paginator.php | Paginator.getPage | public function getPage()
{
if ($this->getOption('page')) {
return $this->getOption('page');
}
$requestPage = $this->getRequest()->__get($this->getOption('pageVariable'));
$page = ($requestPage > 0) ? $requestPage : 1;
$this->setPage($page);
return $page;
... | php | public function getPage()
{
if ($this->getOption('page')) {
return $this->getOption('page');
}
$requestPage = $this->getRequest()->__get($this->getOption('pageVariable'));
$page = ($requestPage > 0) ? $requestPage : 1;
$this->setPage($page);
return $page;
... | [
"public",
"function",
"getPage",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getOption",
"(",
"'page'",
")",
")",
"{",
"return",
"$",
"this",
"->",
"getOption",
"(",
"'page'",
")",
";",
"}",
"$",
"requestPage",
"=",
"$",
"this",
"->",
"getRequest",... | Pobiera numer aktualnej strony
@return integer | [
"Pobiera",
"numer",
"aktualnej",
"strony"
] | c1e8dddf83665ad3463ff801074aa2b0875db19b | https://github.com/milejko/mmi/blob/c1e8dddf83665ad3463ff801074aa2b0875db19b/src/Mmi/Paginator/Paginator.php#L62-L71 |
28,243 | milejko/mmi | src/Mmi/Orm/QueryData.php | QueryData._prepareFields | protected final function _prepareFields()
{
//jeśli pusty schemat połączeń
if (empty($this->_query->getQueryCompile()->joinSchema)) {
return '*';
}
$fields = '';
//pobranie struktury tabeli
$mainStructure = DbConnector::getTableStructure($this->_query->get... | php | protected final function _prepareFields()
{
//jeśli pusty schemat połączeń
if (empty($this->_query->getQueryCompile()->joinSchema)) {
return '*';
}
$fields = '';
//pobranie struktury tabeli
$mainStructure = DbConnector::getTableStructure($this->_query->get... | [
"protected",
"final",
"function",
"_prepareFields",
"(",
")",
"{",
"//jeśli pusty schemat połączeń",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"_query",
"->",
"getQueryCompile",
"(",
")",
"->",
"joinSchema",
")",
")",
"{",
"return",
"'*'",
";",
"}",
"$",
... | Przygotowuje pola do selecta
@return string | [
"Przygotowuje",
"pola",
"do",
"selecta"
] | c1e8dddf83665ad3463ff801074aa2b0875db19b | https://github.com/milejko/mmi/blob/c1e8dddf83665ad3463ff801074aa2b0875db19b/src/Mmi/Orm/QueryData.php#L172-L200 |
28,244 | honeybee/honeybee | src/Model/Aggregate/AggregateRootType.php | AggregateRootType.getDefaultAttributes | public function getDefaultAttributes()
{
$default_attributes = [
new TextAttribute('identifier', $this),
new IntegerAttribute('revision', $this, [ 'default_value' => 0 ]),
new UuidAttribute('uuid', $this, [ 'default_value' => 'auto_gen' ]),
new TextAttribute('... | php | public function getDefaultAttributes()
{
$default_attributes = [
new TextAttribute('identifier', $this),
new IntegerAttribute('revision', $this, [ 'default_value' => 0 ]),
new UuidAttribute('uuid', $this, [ 'default_value' => 'auto_gen' ]),
new TextAttribute('... | [
"public",
"function",
"getDefaultAttributes",
"(",
")",
"{",
"$",
"default_attributes",
"=",
"[",
"new",
"TextAttribute",
"(",
"'identifier'",
",",
"$",
"this",
")",
",",
"new",
"IntegerAttribute",
"(",
"'revision'",
",",
"$",
"this",
",",
"[",
"'default_value... | Returns the default attributes that are initially added to a aggregate_root_type upon creation.
@return array A list of AttributeInterface implementations. | [
"Returns",
"the",
"default",
"attributes",
"that",
"are",
"initially",
"added",
"to",
"a",
"aggregate_root_type",
"upon",
"creation",
"."
] | 6e46b4f20a0b8a3ce686565440f739960e325a05 | https://github.com/honeybee/honeybee/blob/6e46b4f20a0b8a3ce686565440f739960e325a05/src/Model/Aggregate/AggregateRootType.php#L85-L103 |
28,245 | milejko/mmi | src/Mmi/Mvc/ViewHelper/HeadScript.php | HeadScript.appendFile | public function appendFile($src, $type = 'text/javascript', array $params = [], $conditional = '')
{
return $this->setFile($src, $type, $params, false, $conditional);
} | php | public function appendFile($src, $type = 'text/javascript', array $params = [], $conditional = '')
{
return $this->setFile($src, $type, $params, false, $conditional);
} | [
"public",
"function",
"appendFile",
"(",
"$",
"src",
",",
"$",
"type",
"=",
"'text/javascript'",
",",
"array",
"$",
"params",
"=",
"[",
"]",
",",
"$",
"conditional",
"=",
"''",
")",
"{",
"return",
"$",
"this",
"->",
"setFile",
"(",
"$",
"src",
",",
... | Dodaje na koniec stosu skrypt z pliku
@param string $src źródło
@param string $type typ
@param array $params dodatkowe parametry
@param string $conditional warunek np. ie6
@return \Mmi\Mvc\ViewHelper\HeadScript | [
"Dodaje",
"na",
"koniec",
"stosu",
"skrypt",
"z",
"pliku"
] | c1e8dddf83665ad3463ff801074aa2b0875db19b | https://github.com/milejko/mmi/blob/c1e8dddf83665ad3463ff801074aa2b0875db19b/src/Mmi/Mvc/ViewHelper/HeadScript.php#L92-L95 |
28,246 | milejko/mmi | src/Mmi/Mvc/ViewHelper/HeadScript.php | HeadScript.setFile | public function setFile($src, $type = 'text/javascript', array $params = [], $prepend = false, $conditional = '')
{
//pobieranie timestampu
$ts = $this->_getLocationTimestamp($src);
return $this->headScript(array_merge($params, ['type' => $type, 'src' => $ts > 0 ? $this->_getPublicSrc($src) ... | php | public function setFile($src, $type = 'text/javascript', array $params = [], $prepend = false, $conditional = '')
{
//pobieranie timestampu
$ts = $this->_getLocationTimestamp($src);
return $this->headScript(array_merge($params, ['type' => $type, 'src' => $ts > 0 ? $this->_getPublicSrc($src) ... | [
"public",
"function",
"setFile",
"(",
"$",
"src",
",",
"$",
"type",
"=",
"'text/javascript'",
",",
"array",
"$",
"params",
"=",
"[",
"]",
",",
"$",
"prepend",
"=",
"false",
",",
"$",
"conditional",
"=",
"''",
")",
"{",
"//pobieranie timestampu",
"$",
"... | Dodaje do stosu skrypt z pliku
@param string $src źródło
@param string $type typ
@param array $params dodatkowe parametry
@param boolean $prepend dodaj na początek stosu
@param string $conditional warunek np. ie6
@return \Mmi\Mvc\ViewHelper\HeadScript | [
"Dodaje",
"do",
"stosu",
"skrypt",
"z",
"pliku"
] | c1e8dddf83665ad3463ff801074aa2b0875db19b | https://github.com/milejko/mmi/blob/c1e8dddf83665ad3463ff801074aa2b0875db19b/src/Mmi/Mvc/ViewHelper/HeadScript.php#L119-L124 |
28,247 | peakphp/framework | src/Backpack/Bootstrap/Session.php | Session.boot | public function boot()
{
if ((php_sapi_name() === 'cli' || defined('STDIN'))) {
return;
}
if (session_status() == PHP_SESSION_ACTIVE) {
throw new Exception('Session is already started');
}
// save path
if ($this->app->hasProp($this->sessionPr... | php | public function boot()
{
if ((php_sapi_name() === 'cli' || defined('STDIN'))) {
return;
}
if (session_status() == PHP_SESSION_ACTIVE) {
throw new Exception('Session is already started');
}
// save path
if ($this->app->hasProp($this->sessionPr... | [
"public",
"function",
"boot",
"(",
")",
"{",
"if",
"(",
"(",
"php_sapi_name",
"(",
")",
"===",
"'cli'",
"||",
"defined",
"(",
"'STDIN'",
")",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"session_status",
"(",
")",
"==",
"PHP_SESSION_ACTIVE",
")",
"... | Setup and start session from app props
@throws Exception | [
"Setup",
"and",
"start",
"session",
"from",
"app",
"props"
] | 412c13c2a0f165ee645eb3636f23a74a81429d3a | https://github.com/peakphp/framework/blob/412c13c2a0f165ee645eb3636f23a74a81429d3a/src/Backpack/Bootstrap/Session.php#L45-L78 |
28,248 | milejko/mmi | src/Mmi/Mvc/Router.php | Router.encodeUrl | public function encodeUrl(array $params = [])
{
//pusty url
$url = '';
//aplikacja rout
foreach ($this->getRoutes() as $route) {
/* @var $route \Mmi\Mvc\RouterConfigRoute */
$result = (new RouterMatcher)->tryRouteForParams($route, array_merge($route->default, ... | php | public function encodeUrl(array $params = [])
{
//pusty url
$url = '';
//aplikacja rout
foreach ($this->getRoutes() as $route) {
/* @var $route \Mmi\Mvc\RouterConfigRoute */
$result = (new RouterMatcher)->tryRouteForParams($route, array_merge($route->default, ... | [
"public",
"function",
"encodeUrl",
"(",
"array",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"//pusty url",
"$",
"url",
"=",
"''",
";",
"//aplikacja rout",
"foreach",
"(",
"$",
"this",
"->",
"getRoutes",
"(",
")",
"as",
"$",
"route",
")",
"{",
"/* @var $ro... | Koduje parametry na URL zgodnie z wczytanymi trasami
@param array $params parametry
@return string | [
"Koduje",
"parametry",
"na",
"URL",
"zgodnie",
"z",
"wczytanymi",
"trasami"
] | c1e8dddf83665ad3463ff801074aa2b0875db19b | https://github.com/milejko/mmi/blob/c1e8dddf83665ad3463ff801074aa2b0875db19b/src/Mmi/Mvc/Router.php#L105-L138 |
28,249 | honeybee/honeybee | src/Common/Util/FileToolkit.php | FileToolkit.guessExtensionForLocalFile | public static function guessExtensionForLocalFile($file_path, $fallback_extension = '')
{
// FILEINFO_MIME would return the mime encoding as well
$finfo = new finfo(FILEINFO_MIME_TYPE);
$mime_type = $finfo->file($file_path);
return static::guessExtensionByMimeType($mime_type, $fallb... | php | public static function guessExtensionForLocalFile($file_path, $fallback_extension = '')
{
// FILEINFO_MIME would return the mime encoding as well
$finfo = new finfo(FILEINFO_MIME_TYPE);
$mime_type = $finfo->file($file_path);
return static::guessExtensionByMimeType($mime_type, $fallb... | [
"public",
"static",
"function",
"guessExtensionForLocalFile",
"(",
"$",
"file_path",
",",
"$",
"fallback_extension",
"=",
"''",
")",
"{",
"// FILEINFO_MIME would return the mime encoding as well",
"$",
"finfo",
"=",
"new",
"finfo",
"(",
"FILEINFO_MIME_TYPE",
")",
";",
... | Returns a file extension guessed for the given local file.
@param string $file_path path to file
@param string $fallback_extension extension to return on failed guess
@return string default file extension for given mime type or fallback extension provided | [
"Returns",
"a",
"file",
"extension",
"guessed",
"for",
"the",
"given",
"local",
"file",
"."
] | 6e46b4f20a0b8a3ce686565440f739960e325a05 | https://github.com/honeybee/honeybee/blob/6e46b4f20a0b8a3ce686565440f739960e325a05/src/Common/Util/FileToolkit.php#L20-L27 |
28,250 | milejko/mmi | src/Mmi/Session/SessionSpace.php | SessionSpace.toArray | public function toArray()
{
return (isset($_SESSION[$this->_namespace]) && is_array($_SESSION[$this->_namespace])) ? $_SESSION[$this->_namespace] : [];
} | php | public function toArray()
{
return (isset($_SESSION[$this->_namespace]) && is_array($_SESSION[$this->_namespace])) ? $_SESSION[$this->_namespace] : [];
} | [
"public",
"function",
"toArray",
"(",
")",
"{",
"return",
"(",
"isset",
"(",
"$",
"_SESSION",
"[",
"$",
"this",
"->",
"_namespace",
"]",
")",
"&&",
"is_array",
"(",
"$",
"_SESSION",
"[",
"$",
"this",
"->",
"_namespace",
"]",
")",
")",
"?",
"$",
"_S... | Zrzuca namespace do tabeli
@return string | [
"Zrzuca",
"namespace",
"do",
"tabeli"
] | c1e8dddf83665ad3463ff801074aa2b0875db19b | https://github.com/milejko/mmi/blob/c1e8dddf83665ad3463ff801074aa2b0875db19b/src/Mmi/Session/SessionSpace.php#L106-L109 |
28,251 | milejko/mmi | src/Mmi/Navigation/NavigationConfigElement.php | NavigationConfigElement.addChild | public function addChild(\Mmi\Navigation\NavigationConfigElement $element)
{
$this->_options['children'][$element->getId()] = $element;
return $this;
} | php | public function addChild(\Mmi\Navigation\NavigationConfigElement $element)
{
$this->_options['children'][$element->getId()] = $element;
return $this;
} | [
"public",
"function",
"addChild",
"(",
"\\",
"Mmi",
"\\",
"Navigation",
"\\",
"NavigationConfigElement",
"$",
"element",
")",
"{",
"$",
"this",
"->",
"_options",
"[",
"'children'",
"]",
"[",
"$",
"element",
"->",
"getId",
"(",
")",
"]",
"=",
"$",
"elemen... | Dodaje element potomny
@param \Mmi\Navigation\NavigationConfigElement $element
@return \Mmi\Navigation\NavigationConfigElement | [
"Dodaje",
"element",
"potomny"
] | c1e8dddf83665ad3463ff801074aa2b0875db19b | https://github.com/milejko/mmi/blob/c1e8dddf83665ad3463ff801074aa2b0875db19b/src/Mmi/Navigation/NavigationConfigElement.php#L163-L167 |
28,252 | peakphp/framework | src/Backpack/BlackMagic.php | BlackMagic.createApp | public static function createApp(string $environment = 'dev', Dictionary $props = null)
{
$container = new Container();
$kernel = new Kernel($environment, $container);
$handlerResolver = new HandlerResolver($container);
$props = $props ?? new PropertiesBag();
return new Appli... | php | public static function createApp(string $environment = 'dev', Dictionary $props = null)
{
$container = new Container();
$kernel = new Kernel($environment, $container);
$handlerResolver = new HandlerResolver($container);
$props = $props ?? new PropertiesBag();
return new Appli... | [
"public",
"static",
"function",
"createApp",
"(",
"string",
"$",
"environment",
"=",
"'dev'",
",",
"Dictionary",
"$",
"props",
"=",
"null",
")",
"{",
"$",
"container",
"=",
"new",
"Container",
"(",
")",
";",
"$",
"kernel",
"=",
"new",
"Kernel",
"(",
"$... | Create an app!
@param string $environment
@param Dictionary|null $props
@return Application | [
"Create",
"an",
"app!"
] | 412c13c2a0f165ee645eb3636f23a74a81429d3a | https://github.com/peakphp/framework/blob/412c13c2a0f165ee645eb3636f23a74a81429d3a/src/Backpack/BlackMagic.php#L35-L46 |
28,253 | peakphp/framework | src/Backpack/BlackMagic.php | BlackMagic.runThis | public static function runThis(Application $app, array $handlers, ServerRequestInterface $request)
{
return $app->set($handlers)
->run($request, new Emitter());
} | php | public static function runThis(Application $app, array $handlers, ServerRequestInterface $request)
{
return $app->set($handlers)
->run($request, new Emitter());
} | [
"public",
"static",
"function",
"runThis",
"(",
"Application",
"$",
"app",
",",
"array",
"$",
"handlers",
",",
"ServerRequestInterface",
"$",
"request",
")",
"{",
"return",
"$",
"app",
"->",
"set",
"(",
"$",
"handlers",
")",
"->",
"run",
"(",
"$",
"reque... | Handle And Emit !
@param Application $app
@param array $handlers
@param ServerRequestInterface $request
@return mixed | [
"Handle",
"And",
"Emit",
"!"
] | 412c13c2a0f165ee645eb3636f23a74a81429d3a | https://github.com/peakphp/framework/blob/412c13c2a0f165ee645eb3636f23a74a81429d3a/src/Backpack/BlackMagic.php#L91-L95 |
28,254 | quazardous/ImageStack | src/ImageStack/StorageBackend/FileStorageBackend.php | FileStorageBackend.writeImageFile | protected function writeImageFile(ImageInterface $image, ImagePathInterface $path) {
$filename = sanitize_path(implode(DIRECTORY_SEPARATOR, [
$this->getOption('root'),
/**
* The stack prefix is the part of the URL that is used to detect wich stack to trigger.
* This implementation aims to st... | php | protected function writeImageFile(ImageInterface $image, ImagePathInterface $path) {
$filename = sanitize_path(implode(DIRECTORY_SEPARATOR, [
$this->getOption('root'),
/**
* The stack prefix is the part of the URL that is used to detect wich stack to trigger.
* This implementation aims to st... | [
"protected",
"function",
"writeImageFile",
"(",
"ImageInterface",
"$",
"image",
",",
"ImagePathInterface",
"$",
"path",
")",
"{",
"$",
"filename",
"=",
"sanitize_path",
"(",
"implode",
"(",
"DIRECTORY_SEPARATOR",
",",
"[",
"$",
"this",
"->",
"getOption",
"(",
... | Write image to FS.
@param string $binaryContent
@param ImagePathInterface $path
@throws StorageBackendException | [
"Write",
"image",
"to",
"FS",
"."
] | bca5632edfc7703300407984bbaefb3c91c1560c | https://github.com/quazardous/ImageStack/blob/bca5632edfc7703300407984bbaefb3c91c1560c/src/ImageStack/StorageBackend/FileStorageBackend.php#L49-L69 |
28,255 | honeybee/honeybee | src/Infrastructure/DataAccess/UnitOfWork/UnitOfWork.php | UnitOfWork.checkout | public function checkout($aggregate_root_id)
{
$aggregate_root = $this->create();
$event_stream = $this->event_reader->read($aggregate_root_id);
if ($event_stream) {
$aggregate_root->reconstituteFrom($event_stream->getEvents());
} else {
$this->logger->debug(... | php | public function checkout($aggregate_root_id)
{
$aggregate_root = $this->create();
$event_stream = $this->event_reader->read($aggregate_root_id);
if ($event_stream) {
$aggregate_root->reconstituteFrom($event_stream->getEvents());
} else {
$this->logger->debug(... | [
"public",
"function",
"checkout",
"(",
"$",
"aggregate_root_id",
")",
"{",
"$",
"aggregate_root",
"=",
"$",
"this",
"->",
"create",
"(",
")",
";",
"$",
"event_stream",
"=",
"$",
"this",
"->",
"event_reader",
"->",
"read",
"(",
"$",
"aggregate_root_id",
")"... | Checkout the aggregate-root for a given identifier.
@param string $aggregate_root_id
@return AggregateRootInterface | [
"Checkout",
"the",
"aggregate",
"-",
"root",
"for",
"a",
"given",
"identifier",
"."
] | 6e46b4f20a0b8a3ce686565440f739960e325a05 | https://github.com/honeybee/honeybee/blob/6e46b4f20a0b8a3ce686565440f739960e325a05/src/Infrastructure/DataAccess/UnitOfWork/UnitOfWork.php#L99-L113 |
28,256 | honeybee/honeybee | src/Infrastructure/DataAccess/UnitOfWork/UnitOfWork.php | UnitOfWork.commit | public function commit()
{
$committed_events_map = new AggregateRootEventListMap;
$comitted_ars = [];
foreach ($this->tracked_aggregate_roots as $aggregate_root) {
$event_stream = $this->tracked_aggregate_roots[$aggregate_root];
$committed_events_list = new AggregateR... | php | public function commit()
{
$committed_events_map = new AggregateRootEventListMap;
$comitted_ars = [];
foreach ($this->tracked_aggregate_roots as $aggregate_root) {
$event_stream = $this->tracked_aggregate_roots[$aggregate_root];
$committed_events_list = new AggregateR... | [
"public",
"function",
"commit",
"(",
")",
"{",
"$",
"committed_events_map",
"=",
"new",
"AggregateRootEventListMap",
";",
"$",
"comitted_ars",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"tracked_aggregate_roots",
"as",
"$",
"aggregate_root",
")",
"... | Commit all changes that are pending for our tracked aggregate-roots.
@return AggregateRootEventList Returns a list of events that were actually committed. | [
"Commit",
"all",
"changes",
"that",
"are",
"pending",
"for",
"our",
"tracked",
"aggregate",
"-",
"roots",
"."
] | 6e46b4f20a0b8a3ce686565440f739960e325a05 | https://github.com/honeybee/honeybee/blob/6e46b4f20a0b8a3ce686565440f739960e325a05/src/Infrastructure/DataAccess/UnitOfWork/UnitOfWork.php#L120-L142 |
28,257 | honeybee/honeybee | src/Infrastructure/DataAccess/UnitOfWork/UnitOfWork.php | UnitOfWork.startTracking | protected function startTracking(AggregateRootInterface $aggregate_root)
{
if ($this->tracked_aggregate_roots->contains($aggregate_root)) {
throw new RuntimeError("Trying to checkout aggregate that already has a session open.");
}
$aggregate_root_id = $aggregate_root->getIdentif... | php | protected function startTracking(AggregateRootInterface $aggregate_root)
{
if ($this->tracked_aggregate_roots->contains($aggregate_root)) {
throw new RuntimeError("Trying to checkout aggregate that already has a session open.");
}
$aggregate_root_id = $aggregate_root->getIdentif... | [
"protected",
"function",
"startTracking",
"(",
"AggregateRootInterface",
"$",
"aggregate_root",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"tracked_aggregate_roots",
"->",
"contains",
"(",
"$",
"aggregate_root",
")",
")",
"{",
"throw",
"new",
"RuntimeError",
"(",
"... | Register the given aggregate-root to our event stream map.
@param AggregateRootInterface $aggregate_root | [
"Register",
"the",
"given",
"aggregate",
"-",
"root",
"to",
"our",
"event",
"stream",
"map",
"."
] | 6e46b4f20a0b8a3ce686565440f739960e325a05 | https://github.com/honeybee/honeybee/blob/6e46b4f20a0b8a3ce686565440f739960e325a05/src/Infrastructure/DataAccess/UnitOfWork/UnitOfWork.php#L154-L162 |
28,258 | milejko/mmi | src/Mmi/Orm/Builder.php | Builder.buildFromTableName | public static function buildFromTableName($tableName)
{
//pomijanie modułów z vendorów
foreach (\Mmi\Mvc\StructureParser::getModules() as $module) {
if (strtolower(basename($module)) == explode('_', $tableName)[0] && false !== strpos($module, 'vendor')) {
return;
... | php | public static function buildFromTableName($tableName)
{
//pomijanie modułów z vendorów
foreach (\Mmi\Mvc\StructureParser::getModules() as $module) {
if (strtolower(basename($module)) == explode('_', $tableName)[0] && false !== strpos($module, 'vendor')) {
return;
... | [
"public",
"static",
"function",
"buildFromTableName",
"(",
"$",
"tableName",
")",
"{",
"//pomijanie modułów z vendorów",
"foreach",
"(",
"\\",
"Mmi",
"\\",
"Mvc",
"\\",
"StructureParser",
"::",
"getModules",
"(",
")",
"as",
"$",
"module",
")",
"{",
"if",
"(",
... | Renderuje DAO, Record i Query dla podanej nazwy tabeli
@param string $tableName
@throws \Mmi\Orm\OrmException | [
"Renderuje",
"DAO",
"Record",
"i",
"Query",
"dla",
"podanej",
"nazwy",
"tabeli"
] | c1e8dddf83665ad3463ff801074aa2b0875db19b | https://github.com/milejko/mmi/blob/c1e8dddf83665ad3463ff801074aa2b0875db19b/src/Mmi/Orm/Builder.php#L26-L42 |
28,259 | milejko/mmi | src/Mmi/Orm/Builder.php | Builder._updateRecord | protected static function _updateRecord($tableName)
{
//kod rekordu
$recordCode = '<?php' . "\n\n" .
'namespace ' . self::_getNamespace($tableName) . ";\n\n" .
'class ' . ($className = self::_getNamePrefix($tableName) . 'Record') . ' extends \Mmi\Orm\Record' .
"\n... | php | protected static function _updateRecord($tableName)
{
//kod rekordu
$recordCode = '<?php' . "\n\n" .
'namespace ' . self::_getNamespace($tableName) . ";\n\n" .
'class ' . ($className = self::_getNamePrefix($tableName) . 'Record') . ' extends \Mmi\Orm\Record' .
"\n... | [
"protected",
"static",
"function",
"_updateRecord",
"(",
"$",
"tableName",
")",
"{",
"//kod rekordu",
"$",
"recordCode",
"=",
"'<?php'",
".",
"\"\\n\\n\"",
".",
"'namespace '",
".",
"self",
"::",
"_getNamespace",
"(",
"$",
"tableName",
")",
".",
"\";\\n\\n\"",
... | Tworzy, lub aktualizuje rekord
@param string $tableName | [
"Tworzy",
"lub",
"aktualizuje",
"rekord"
] | c1e8dddf83665ad3463ff801074aa2b0875db19b | https://github.com/milejko/mmi/blob/c1e8dddf83665ad3463ff801074aa2b0875db19b/src/Mmi/Orm/Builder.php#L48-L90 |
28,260 | milejko/mmi | src/Mmi/Orm/Builder.php | Builder._updateQueryField | protected static function _updateQueryField($tableName)
{
//prefixy nazw
$queryClassName = self::_getNamespace($tableName) . '\\' . self::_getNamePrefix($tableName) . 'Query';
//odczyt struktury
$structure = DbConnector::getTableStructure($tableName);
$methods = '';
/... | php | protected static function _updateQueryField($tableName)
{
//prefixy nazw
$queryClassName = self::_getNamespace($tableName) . '\\' . self::_getNamePrefix($tableName) . 'Query';
//odczyt struktury
$structure = DbConnector::getTableStructure($tableName);
$methods = '';
/... | [
"protected",
"static",
"function",
"_updateQueryField",
"(",
"$",
"tableName",
")",
"{",
"//prefixy nazw",
"$",
"queryClassName",
"=",
"self",
"::",
"_getNamespace",
"(",
"$",
"tableName",
")",
".",
"'\\\\'",
".",
"self",
"::",
"_getNamePrefix",
"(",
"$",
"tab... | Tworzy lub aktualizuje pole query
@param string $tableName | [
"Tworzy",
"lub",
"aktualizuje",
"pole",
"query"
] | c1e8dddf83665ad3463ff801074aa2b0875db19b | https://github.com/milejko/mmi/blob/c1e8dddf83665ad3463ff801074aa2b0875db19b/src/Mmi/Orm/Builder.php#L96-L140 |
28,261 | milejko/mmi | src/Mmi/Orm/Builder.php | Builder._getNamePrefix | protected static function _getNamePrefix($tableName)
{
$table = explode('_', $tableName);
$className = '';
//dodawanie kolejnych zagłębień
foreach ($table as $section) {
$className .= ucfirst($section);
}
return $className;
} | php | protected static function _getNamePrefix($tableName)
{
$table = explode('_', $tableName);
$className = '';
//dodawanie kolejnych zagłębień
foreach ($table as $section) {
$className .= ucfirst($section);
}
return $className;
} | [
"protected",
"static",
"function",
"_getNamePrefix",
"(",
"$",
"tableName",
")",
"{",
"$",
"table",
"=",
"explode",
"(",
"'_'",
",",
"$",
"tableName",
")",
";",
"$",
"className",
"=",
"''",
";",
"//dodawanie kolejnych zagłębień",
"foreach",
"(",
"$",
"table"... | Pobiera prefix klasy obiektu
@param string $tableName
@return string
@throws \Mmi\Orm\OrmException | [
"Pobiera",
"prefix",
"klasy",
"obiektu"
] | c1e8dddf83665ad3463ff801074aa2b0875db19b | https://github.com/milejko/mmi/blob/c1e8dddf83665ad3463ff801074aa2b0875db19b/src/Mmi/Orm/Builder.php#L274-L283 |
28,262 | quazardous/ImageStack | src/ImageStack/ImageBackend/HttpImageBackend.php | HttpImageBackend.getImageUrl | protected function getImageUrl(ImagePathInterface $path) {
$url = $path->getPath();
if ($this->getOption('use_prefix', false)) {
$url = rtrim($path->getPrefix(), '/') . '/' . $url;
}
if ($this->getOption('root_url')) {
$url = rtrim($this->getOption('root_url'), '/') . '/' . $url;
... | php | protected function getImageUrl(ImagePathInterface $path) {
$url = $path->getPath();
if ($this->getOption('use_prefix', false)) {
$url = rtrim($path->getPrefix(), '/') . '/' . $url;
}
if ($this->getOption('root_url')) {
$url = rtrim($this->getOption('root_url'), '/') . '/' . $url;
... | [
"protected",
"function",
"getImageUrl",
"(",
"ImagePathInterface",
"$",
"path",
")",
"{",
"$",
"url",
"=",
"$",
"path",
"->",
"getPath",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"getOption",
"(",
"'use_prefix'",
",",
"false",
")",
")",
"{",
"$",
... | Get the image URL.
@param ImagePathInterface $path
@return string | [
"Get",
"the",
"image",
"URL",
"."
] | bca5632edfc7703300407984bbaefb3c91c1560c | https://github.com/quazardous/ImageStack/blob/bca5632edfc7703300407984bbaefb3c91c1560c/src/ImageStack/ImageBackend/HttpImageBackend.php#L51-L60 |
28,263 | quazardous/ImageStack | src/ImageStack/ImageBackend/HttpImageBackend.php | HttpImageBackend.httpRequest | protected function httpRequest($url, &$content)
{
$client = new Client([
'allow_redirects' => true,
'curl' => $this->getOption('curl', []),
]);
try {
$response = $client->request('GET', $url);
} catch (RequestException $e) {
if ($e->has... | php | protected function httpRequest($url, &$content)
{
$client = new Client([
'allow_redirects' => true,
'curl' => $this->getOption('curl', []),
]);
try {
$response = $client->request('GET', $url);
} catch (RequestException $e) {
if ($e->has... | [
"protected",
"function",
"httpRequest",
"(",
"$",
"url",
",",
"&",
"$",
"content",
")",
"{",
"$",
"client",
"=",
"new",
"Client",
"(",
"[",
"'allow_redirects'",
"=>",
"true",
",",
"'curl'",
"=>",
"$",
"this",
"->",
"getOption",
"(",
"'curl'",
",",
"[",... | Perform HTTP query.
@param string $url
@param string &$content
@return string|null MIME type | [
"Perform",
"HTTP",
"query",
"."
] | bca5632edfc7703300407984bbaefb3c91c1560c | https://github.com/quazardous/ImageStack/blob/bca5632edfc7703300407984bbaefb3c91c1560c/src/ImageStack/ImageBackend/HttpImageBackend.php#L75-L98 |
28,264 | icewind1991/Streams | src/Path.php | Path.appendDefaultContent | protected function appendDefaultContent($values) {
if (!is_array(current($values))) {
$values = [$this->getProtocol() => $values];
}
$context = stream_context_get_default();
$defaults = stream_context_get_options($context);
foreach ($values as $key => $value) {
$defaults[$key] = $value;
}
stream_con... | php | protected function appendDefaultContent($values) {
if (!is_array(current($values))) {
$values = [$this->getProtocol() => $values];
}
$context = stream_context_get_default();
$defaults = stream_context_get_options($context);
foreach ($values as $key => $value) {
$defaults[$key] = $value;
}
stream_con... | [
"protected",
"function",
"appendDefaultContent",
"(",
"$",
"values",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"current",
"(",
"$",
"values",
")",
")",
")",
"{",
"$",
"values",
"=",
"[",
"$",
"this",
"->",
"getProtocol",
"(",
")",
"=>",
"$",
"values... | Add values to the default stream context
@param array $values | [
"Add",
"values",
"to",
"the",
"default",
"stream",
"context"
] | 6c91d3e390736d9c8c27527f9c5667bc21dca571 | https://github.com/icewind1991/Streams/blob/6c91d3e390736d9c8c27527f9c5667bc21dca571/src/Path.php#L76-L86 |
28,265 | icewind1991/Streams | src/Path.php | Path.unsetDefaultContent | protected function unsetDefaultContent($key) {
$context = stream_context_get_default();
$defaults = stream_context_get_options($context);
unset($defaults[$key]);
stream_context_set_default($defaults);
} | php | protected function unsetDefaultContent($key) {
$context = stream_context_get_default();
$defaults = stream_context_get_options($context);
unset($defaults[$key]);
stream_context_set_default($defaults);
} | [
"protected",
"function",
"unsetDefaultContent",
"(",
"$",
"key",
")",
"{",
"$",
"context",
"=",
"stream_context_get_default",
"(",
")",
";",
"$",
"defaults",
"=",
"stream_context_get_options",
"(",
"$",
"context",
")",
";",
"unset",
"(",
"$",
"defaults",
"[",
... | Remove values from the default stream context
@param string $key | [
"Remove",
"values",
"from",
"the",
"default",
"stream",
"context"
] | 6c91d3e390736d9c8c27527f9c5667bc21dca571 | https://github.com/icewind1991/Streams/blob/6c91d3e390736d9c8c27527f9c5667bc21dca571/src/Path.php#L93-L98 |
28,266 | honeybee/honeybee | src/Projection/EntityType.php | EntityType.createMirroredEntity | public function createMirroredEntity(EntityInterface $source_entity, EntityInterface $reference_entity = null)
{
// compile non-list attribute values from the reference entity if available
if ($reference_entity) {
foreach ($this->getAttributes() as $attribute) {
$attribut... | php | public function createMirroredEntity(EntityInterface $source_entity, EntityInterface $reference_entity = null)
{
// compile non-list attribute values from the reference entity if available
if ($reference_entity) {
foreach ($this->getAttributes() as $attribute) {
$attribut... | [
"public",
"function",
"createMirroredEntity",
"(",
"EntityInterface",
"$",
"source_entity",
",",
"EntityInterface",
"$",
"reference_entity",
"=",
"null",
")",
"{",
"// compile non-list attribute values from the reference entity if available",
"if",
"(",
"$",
"reference_entity",... | Create a new entity from the recursively mirrorred values of a given source entity, while
optionally merging attribute values from a given reference entity.
@param EntityInterface $source_entity
@param EntityInterface $reference_entity
@return EntityInterface | [
"Create",
"a",
"new",
"entity",
"from",
"the",
"recursively",
"mirrorred",
"values",
"of",
"a",
"given",
"source",
"entity",
"while",
"optionally",
"merging",
"attribute",
"values",
"from",
"a",
"given",
"reference",
"entity",
"."
] | 6e46b4f20a0b8a3ce686565440f739960e325a05 | https://github.com/honeybee/honeybee/blob/6e46b4f20a0b8a3ce686565440f739960e325a05/src/Projection/EntityType.php#L24-L96 |
28,267 | peakphp/framework | src/Backpack/AppBuilder.php | AppBuilder.triggerKernelError | private function triggerKernelError()
{
$msgErrorSuffix = 'setting will be ignored because Kernel had been set previously.';
if (isset($this->container)) {
trigger_error('Container '.$msgErrorSuffix);
}
if (isset($this->env)) {
trigger_error('Env '.$msgErrorSu... | php | private function triggerKernelError()
{
$msgErrorSuffix = 'setting will be ignored because Kernel had been set previously.';
if (isset($this->container)) {
trigger_error('Container '.$msgErrorSuffix);
}
if (isset($this->env)) {
trigger_error('Env '.$msgErrorSu... | [
"private",
"function",
"triggerKernelError",
"(",
")",
"{",
"$",
"msgErrorSuffix",
"=",
"'setting will be ignored because Kernel had been set previously.'",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"container",
")",
")",
"{",
"trigger_error",
"(",
"'Container ... | Trigger an error with arguments container and env when a kernel has been set previously | [
"Trigger",
"an",
"error",
"with",
"arguments",
"container",
"and",
"env",
"when",
"a",
"kernel",
"has",
"been",
"set",
"previously"
] | 412c13c2a0f165ee645eb3636f23a74a81429d3a | https://github.com/peakphp/framework/blob/412c13c2a0f165ee645eb3636f23a74a81429d3a/src/Backpack/AppBuilder.php#L220-L232 |
28,268 | peakphp/framework | src/Collection/CollectionFlattener.php | CollectionFlattener.separator | public function separator(string $sep): CollectionFlattener
{
if (mb_strlen($sep) != 1 || $sep === '*') {
throw new Exception(__CLASS__.': Separator must be 1 character and cannot be an asterisk (*)');
}
$this->separator = $sep;
return $this;
} | php | public function separator(string $sep): CollectionFlattener
{
if (mb_strlen($sep) != 1 || $sep === '*') {
throw new Exception(__CLASS__.': Separator must be 1 character and cannot be an asterisk (*)');
}
$this->separator = $sep;
return $this;
} | [
"public",
"function",
"separator",
"(",
"string",
"$",
"sep",
")",
":",
"CollectionFlattener",
"{",
"if",
"(",
"mb_strlen",
"(",
"$",
"sep",
")",
"!=",
"1",
"||",
"$",
"sep",
"===",
"'*'",
")",
"{",
"throw",
"new",
"Exception",
"(",
"__CLASS__",
".",
... | Change keys separators
@param string $sep
@return $this
@throws Exception | [
"Change",
"keys",
"separators"
] | 412c13c2a0f165ee645eb3636f23a74a81429d3a | https://github.com/peakphp/framework/blob/412c13c2a0f165ee645eb3636f23a74a81429d3a/src/Collection/CollectionFlattener.php#L47-L54 |
28,269 | peakphp/framework | src/Collection/CollectionFlattener.php | CollectionFlattener.flatKeys | public function flatKeys(array $keys): array
{
$this->search = $keys;
return $this->flatCollection($this->collection->toArray());
} | php | public function flatKeys(array $keys): array
{
$this->search = $keys;
return $this->flatCollection($this->collection->toArray());
} | [
"public",
"function",
"flatKeys",
"(",
"array",
"$",
"keys",
")",
":",
"array",
"{",
"$",
"this",
"->",
"search",
"=",
"$",
"keys",
";",
"return",
"$",
"this",
"->",
"flatCollection",
"(",
"$",
"this",
"->",
"collection",
"->",
"toArray",
"(",
")",
"... | Flat multiple keys names
@param array $keys
@return array | [
"Flat",
"multiple",
"keys",
"names"
] | 412c13c2a0f165ee645eb3636f23a74a81429d3a | https://github.com/peakphp/framework/blob/412c13c2a0f165ee645eb3636f23a74a81429d3a/src/Collection/CollectionFlattener.php#L81-L85 |
28,270 | peakphp/framework | src/Collection/CollectionFlattener.php | CollectionFlattener.flatCollection | protected function flatCollection(array $data, string $prefix = null, array $flat_data = []): array
{
foreach ($data as $key => $val) {
if ($prefix !== null) {
$key = $prefix.$this->separator.$key;
}
$skip_key = $this->skipKey($key);
if (is_a... | php | protected function flatCollection(array $data, string $prefix = null, array $flat_data = []): array
{
foreach ($data as $key => $val) {
if ($prefix !== null) {
$key = $prefix.$this->separator.$key;
}
$skip_key = $this->skipKey($key);
if (is_a... | [
"protected",
"function",
"flatCollection",
"(",
"array",
"$",
"data",
",",
"string",
"$",
"prefix",
"=",
"null",
",",
"array",
"$",
"flat_data",
"=",
"[",
"]",
")",
":",
"array",
"{",
"foreach",
"(",
"$",
"data",
"as",
"$",
"key",
"=>",
"$",
"val",
... | Flat collection recursively to one level key,val array
@param array $data
@param string|null $prefix
@param array $flat_data
@return array | [
"Flat",
"collection",
"recursively",
"to",
"one",
"level",
"key",
"val",
"array"
] | 412c13c2a0f165ee645eb3636f23a74a81429d3a | https://github.com/peakphp/framework/blob/412c13c2a0f165ee645eb3636f23a74a81429d3a/src/Collection/CollectionFlattener.php#L94-L119 |
28,271 | milejko/mmi | src/Mmi/OptionObject.php | OptionObject.setOptions | public function setOptions(array $options = [], $reset = false)
{
//jeśli reset
if ($reset) {
$this->_options = [];
}
//dopełnianie tabeli opcji
foreach ($options as $key => $value) {
$this->setOption($key, $value);
}
return $this;
... | php | public function setOptions(array $options = [], $reset = false)
{
//jeśli reset
if ($reset) {
$this->_options = [];
}
//dopełnianie tabeli opcji
foreach ($options as $key => $value) {
$this->setOption($key, $value);
}
return $this;
... | [
"public",
"function",
"setOptions",
"(",
"array",
"$",
"options",
"=",
"[",
"]",
",",
"$",
"reset",
"=",
"false",
")",
"{",
"//jeśli reset",
"if",
"(",
"$",
"reset",
")",
"{",
"$",
"this",
"->",
"_options",
"=",
"[",
"]",
";",
"}",
"//dopełnianie tab... | Ustawia wszystkie opcje na podstawie tabeli
@param array $options tabela opcji
@param boolean $reset usuwa poprzednie wartości (domyślnie nie)
@return self | [
"Ustawia",
"wszystkie",
"opcje",
"na",
"podstawie",
"tabeli"
] | c1e8dddf83665ad3463ff801074aa2b0875db19b | https://github.com/milejko/mmi/blob/c1e8dddf83665ad3463ff801074aa2b0875db19b/src/Mmi/OptionObject.php#L83-L94 |
28,272 | milejko/mmi | src/Mmi/Mvc/ViewHelper/Navigation.php | Navigation._modifyBreadcrumbData | protected function _modifyBreadcrumbData($index, $field, $value)
{
//brak wartości
if (!$value) {
return;
}
//ustawienie wartości
$this->_breadcrumbsData[$index][$field] = $value;
} | php | protected function _modifyBreadcrumbData($index, $field, $value)
{
//brak wartości
if (!$value) {
return;
}
//ustawienie wartości
$this->_breadcrumbsData[$index][$field] = $value;
} | [
"protected",
"function",
"_modifyBreadcrumbData",
"(",
"$",
"index",
",",
"$",
"field",
",",
"$",
"value",
")",
"{",
"//brak wartości",
"if",
"(",
"!",
"$",
"value",
")",
"{",
"return",
";",
"}",
"//ustawienie wartości",
"$",
"this",
"->",
"_breadcrumbsData"... | Ustawia pole w danych breadcrumba
@param string $index
@param string $field
@param string $value | [
"Ustawia",
"pole",
"w",
"danych",
"breadcrumba"
] | c1e8dddf83665ad3463ff801074aa2b0875db19b | https://github.com/milejko/mmi/blob/c1e8dddf83665ad3463ff801074aa2b0875db19b/src/Mmi/Mvc/ViewHelper/Navigation.php#L151-L159 |
28,273 | milejko/mmi | src/Mmi/Mvc/ViewHelper/Navigation.php | Navigation.modifyLastBreadcrumb | public function modifyLastBreadcrumb($label, $uri = null, $title = null, $description = null)
{
//modyfikacja + przebudowa
return $this->modifyBreadcrumb(count($this->_breadcrumbsData) - 1, $label, $uri, $title, $description);
} | php | public function modifyLastBreadcrumb($label, $uri = null, $title = null, $description = null)
{
//modyfikacja + przebudowa
return $this->modifyBreadcrumb(count($this->_breadcrumbsData) - 1, $label, $uri, $title, $description);
} | [
"public",
"function",
"modifyLastBreadcrumb",
"(",
"$",
"label",
",",
"$",
"uri",
"=",
"null",
",",
"$",
"title",
"=",
"null",
",",
"$",
"description",
"=",
"null",
")",
"{",
"//modyfikacja + przebudowa",
"return",
"$",
"this",
"->",
"modifyBreadcrumb",
"(",... | Modyfikuje ostatni breadcrumb
@param string $label etykieta
@param string $uri URL
@param string $title tytuł
@param string $description opis
@return \Mmi\Mvc\ViewHelper\Navigation | [
"Modyfikuje",
"ostatni",
"breadcrumb"
] | c1e8dddf83665ad3463ff801074aa2b0875db19b | https://github.com/milejko/mmi/blob/c1e8dddf83665ad3463ff801074aa2b0875db19b/src/Mmi/Mvc/ViewHelper/Navigation.php#L521-L525 |
28,274 | milejko/mmi | src/Mmi/Mvc/ViewHelper/Navigation.php | Navigation.appendBreadcrumb | public function appendBreadcrumb($label, $uri = null, $title = null, $description = null)
{
//append, przebudowa, zwraca siebie
return $this->createBreadcrumb($label, $uri, $title, $description, false);
} | php | public function appendBreadcrumb($label, $uri = null, $title = null, $description = null)
{
//append, przebudowa, zwraca siebie
return $this->createBreadcrumb($label, $uri, $title, $description, false);
} | [
"public",
"function",
"appendBreadcrumb",
"(",
"$",
"label",
",",
"$",
"uri",
"=",
"null",
",",
"$",
"title",
"=",
"null",
",",
"$",
"description",
"=",
"null",
")",
"{",
"//append, przebudowa, zwraca siebie",
"return",
"$",
"this",
"->",
"createBreadcrumb",
... | Dodaje breadcrumb na koniec
@param string $label etykieta
@param string $uri URL
@param string $title tytuł
@param string $description opis
@return \Mmi\Mvc\ViewHelper\Navigation | [
"Dodaje",
"breadcrumb",
"na",
"koniec"
] | c1e8dddf83665ad3463ff801074aa2b0875db19b | https://github.com/milejko/mmi/blob/c1e8dddf83665ad3463ff801074aa2b0875db19b/src/Mmi/Mvc/ViewHelper/Navigation.php#L559-L563 |
28,275 | milejko/mmi | src/Mmi/Mvc/ViewHelper/Navigation.php | Navigation.removeLastBreadcrumb | public function removeLastBreadcrumb()
{
//obliczanie indeksu ostatniego breadcrumba
$index = count($this->_breadcrumbsData) - 1;
//brak breadcrumba
if (!isset($this->_breadcrumbsData[$index])) {
return $this;
}
//usuwanie
unset($this->_breadcrumbs... | php | public function removeLastBreadcrumb()
{
//obliczanie indeksu ostatniego breadcrumba
$index = count($this->_breadcrumbsData) - 1;
//brak breadcrumba
if (!isset($this->_breadcrumbsData[$index])) {
return $this;
}
//usuwanie
unset($this->_breadcrumbs... | [
"public",
"function",
"removeLastBreadcrumb",
"(",
")",
"{",
"//obliczanie indeksu ostatniego breadcrumba",
"$",
"index",
"=",
"count",
"(",
"$",
"this",
"->",
"_breadcrumbsData",
")",
"-",
"1",
";",
"//brak breadcrumba",
"if",
"(",
"!",
"isset",
"(",
"$",
"this... | Usuwa ostatni breadcrumb
@return \Mmi\Mvc\ViewHelper\Navigation | [
"Usuwa",
"ostatni",
"breadcrumb"
] | c1e8dddf83665ad3463ff801074aa2b0875db19b | https://github.com/milejko/mmi/blob/c1e8dddf83665ad3463ff801074aa2b0875db19b/src/Mmi/Mvc/ViewHelper/Navigation.php#L583-L595 |
28,276 | peakphp/framework | src/Http/Stack.php | Stack.handleStack | protected function handleStack(\Peak\Blueprint\Http\Stack $stack, ServerRequestInterface $request): ResponseInterface
{
$stack->setParent($this);
return $stack->handle($request);
} | php | protected function handleStack(\Peak\Blueprint\Http\Stack $stack, ServerRequestInterface $request): ResponseInterface
{
$stack->setParent($this);
return $stack->handle($request);
} | [
"protected",
"function",
"handleStack",
"(",
"\\",
"Peak",
"\\",
"Blueprint",
"\\",
"Http",
"\\",
"Stack",
"$",
"stack",
",",
"ServerRequestInterface",
"$",
"request",
")",
":",
"ResponseInterface",
"{",
"$",
"stack",
"->",
"setParent",
"(",
"$",
"this",
")"... | Handle a child stack
@param \Peak\Blueprint\Http\Stack $stack
@param ServerRequestInterface $request
@return ResponseInterface | [
"Handle",
"a",
"child",
"stack"
] | 412c13c2a0f165ee645eb3636f23a74a81429d3a | https://github.com/peakphp/framework/blob/412c13c2a0f165ee645eb3636f23a74a81429d3a/src/Http/Stack.php#L135-L139 |
28,277 | peakphp/framework | src/Http/Stack.php | Stack.returnResponse | protected function returnResponse(ResponseInterface $response): ResponseInterface
{
$this->nextHandler = null;
reset($this->handlers);
return $response;
} | php | protected function returnResponse(ResponseInterface $response): ResponseInterface
{
$this->nextHandler = null;
reset($this->handlers);
return $response;
} | [
"protected",
"function",
"returnResponse",
"(",
"ResponseInterface",
"$",
"response",
")",
":",
"ResponseInterface",
"{",
"$",
"this",
"->",
"nextHandler",
"=",
"null",
";",
"reset",
"(",
"$",
"this",
"->",
"handlers",
")",
";",
"return",
"$",
"response",
";... | Reset the stack before returning the response,
This allow the stack to be re-handle without throwing exception
@param ResponseInterface $response
@return ResponseInterface | [
"Reset",
"the",
"stack",
"before",
"returning",
"the",
"response",
"This",
"allow",
"the",
"stack",
"to",
"be",
"re",
"-",
"handle",
"without",
"throwing",
"exception"
] | 412c13c2a0f165ee645eb3636f23a74a81429d3a | https://github.com/peakphp/framework/blob/412c13c2a0f165ee645eb3636f23a74a81429d3a/src/Http/Stack.php#L147-L152 |
28,278 | milejko/mmi | src/Mmi/Form/Element/ElementAbstract.php | ElementAbstract._getHtmlOptions | protected final function _getHtmlOptions()
{
$validators = $this->getValidators();
//jeśli istnieją validatory dodajemy klasę validate
if (!empty($validators)) {
$this->addClass('validate');
}
$html = '';
//iteracja po opcjach do HTML
foreach ($thi... | php | protected final function _getHtmlOptions()
{
$validators = $this->getValidators();
//jeśli istnieją validatory dodajemy klasę validate
if (!empty($validators)) {
$this->addClass('validate');
}
$html = '';
//iteracja po opcjach do HTML
foreach ($thi... | [
"protected",
"final",
"function",
"_getHtmlOptions",
"(",
")",
"{",
"$",
"validators",
"=",
"$",
"this",
"->",
"getValidators",
"(",
")",
";",
"//jeśli istnieją validatory dodajemy klasę validate",
"if",
"(",
"!",
"empty",
"(",
"$",
"validators",
")",
")",
"{",
... | Buduje opcje HTML
@return string | [
"Buduje",
"opcje",
"HTML"
] | c1e8dddf83665ad3463ff801074aa2b0875db19b | https://github.com/milejko/mmi/blob/c1e8dddf83665ad3463ff801074aa2b0875db19b/src/Mmi/Form/Element/ElementAbstract.php#L391-L409 |
28,279 | milejko/mmi | src/Mmi/Form/Element/ElementAbstract.php | ElementAbstract.fetchDescription | public final function fetchDescription()
{
//brak opisu
if (!$this->getDescription()) {
return;
}
//element do widoku
\Mmi\App\FrontController::getInstance()->getView()->_element = $this;
//render szablonu
return \Mmi\App\FrontController::getInstan... | php | public final function fetchDescription()
{
//brak opisu
if (!$this->getDescription()) {
return;
}
//element do widoku
\Mmi\App\FrontController::getInstance()->getView()->_element = $this;
//render szablonu
return \Mmi\App\FrontController::getInstan... | [
"public",
"final",
"function",
"fetchDescription",
"(",
")",
"{",
"//brak opisu",
"if",
"(",
"!",
"$",
"this",
"->",
"getDescription",
"(",
")",
")",
"{",
"return",
";",
"}",
"//element do widoku",
"\\",
"Mmi",
"\\",
"App",
"\\",
"FrontController",
"::",
"... | Buduje opis pola
@return string | [
"Buduje",
"opis",
"pola"
] | c1e8dddf83665ad3463ff801074aa2b0875db19b | https://github.com/milejko/mmi/blob/c1e8dddf83665ad3463ff801074aa2b0875db19b/src/Mmi/Form/Element/ElementAbstract.php#L479-L489 |
28,280 | honeybee/honeybee | src/Model/Aggregate/Entity.php | Entity.applyEmbeddedEntityEvent | protected function applyEmbeddedEntityEvent(
EmbeddedEntityEventInterface $embedded_entity_event,
$auto_commit = true
) {
$attribute_name = $embedded_entity_event->getParentAttributeName();
$embedded_entity_list = $this->getValue($attribute_name);
if ($embedded_entity_event ... | php | protected function applyEmbeddedEntityEvent(
EmbeddedEntityEventInterface $embedded_entity_event,
$auto_commit = true
) {
$attribute_name = $embedded_entity_event->getParentAttributeName();
$embedded_entity_list = $this->getValue($attribute_name);
if ($embedded_entity_event ... | [
"protected",
"function",
"applyEmbeddedEntityEvent",
"(",
"EmbeddedEntityEventInterface",
"$",
"embedded_entity_event",
",",
"$",
"auto_commit",
"=",
"true",
")",
"{",
"$",
"attribute_name",
"=",
"$",
"embedded_entity_event",
"->",
"getParentAttributeName",
"(",
")",
";... | Apply the given aggregate-event to it's corresponding aggregate and return the resulting source-event.
@param EmbeddedEntityEventInterface $embedded_entity_event
@param boolean $auto_commit
@return EmbeddedEntityEventInterface | [
"Apply",
"the",
"given",
"aggregate",
"-",
"event",
"to",
"it",
"s",
"corresponding",
"aggregate",
"and",
"return",
"the",
"resulting",
"source",
"-",
"event",
"."
] | 6e46b4f20a0b8a3ce686565440f739960e325a05 | https://github.com/honeybee/honeybee/blob/6e46b4f20a0b8a3ce686565440f739960e325a05/src/Model/Aggregate/Entity.php#L23-L67 |
28,281 | honeybee/honeybee | src/Model/Aggregate/Entity.php | Entity.getEmbeddedEntityTypeFor | protected function getEmbeddedEntityTypeFor($attribute_name, $embedded_type_prefix)
{
$attribute = $this->getType()->getAttribute($attribute_name);
return $attribute->getEmbeddedTypeByPrefix($embedded_type_prefix);
} | php | protected function getEmbeddedEntityTypeFor($attribute_name, $embedded_type_prefix)
{
$attribute = $this->getType()->getAttribute($attribute_name);
return $attribute->getEmbeddedTypeByPrefix($embedded_type_prefix);
} | [
"protected",
"function",
"getEmbeddedEntityTypeFor",
"(",
"$",
"attribute_name",
",",
"$",
"embedded_type_prefix",
")",
"{",
"$",
"attribute",
"=",
"$",
"this",
"->",
"getType",
"(",
")",
"->",
"getAttribute",
"(",
"$",
"attribute_name",
")",
";",
"return",
"$... | Return the AggregateType that is referred to by the given command.
@param string $attribute_name
@param string $embedded_type_prefix
@return EntityTypeInterface | [
"Return",
"the",
"AggregateType",
"that",
"is",
"referred",
"to",
"by",
"the",
"given",
"command",
"."
] | 6e46b4f20a0b8a3ce686565440f739960e325a05 | https://github.com/honeybee/honeybee/blob/6e46b4f20a0b8a3ce686565440f739960e325a05/src/Model/Aggregate/Entity.php#L77-L82 |
28,282 | honeybee/honeybee | src/Model/Aggregate/Entity.php | Entity.getEmbeddedEntityFor | protected function getEmbeddedEntityFor($attribute_name, $embedded_entity_id)
{
$found_entity = null;
foreach ($this->getValue($attribute_name) as $embedded_entity) {
if ($embedded_entity->getIdentifier() === $embedded_entity_id) {
$found_entity = $embedded_entity;
... | php | protected function getEmbeddedEntityFor($attribute_name, $embedded_entity_id)
{
$found_entity = null;
foreach ($this->getValue($attribute_name) as $embedded_entity) {
if ($embedded_entity->getIdentifier() === $embedded_entity_id) {
$found_entity = $embedded_entity;
... | [
"protected",
"function",
"getEmbeddedEntityFor",
"(",
"$",
"attribute_name",
",",
"$",
"embedded_entity_id",
")",
"{",
"$",
"found_entity",
"=",
"null",
";",
"foreach",
"(",
"$",
"this",
"->",
"getValue",
"(",
"$",
"attribute_name",
")",
"as",
"$",
"embedded_e... | Return the Aggregate that is referred to by the given command.
@param string $attribute_name
@param string $embedded_entity_id
@return EntityInterface | [
"Return",
"the",
"Aggregate",
"that",
"is",
"referred",
"to",
"by",
"the",
"given",
"command",
"."
] | 6e46b4f20a0b8a3ce686565440f739960e325a05 | https://github.com/honeybee/honeybee/blob/6e46b4f20a0b8a3ce686565440f739960e325a05/src/Model/Aggregate/Entity.php#L92-L103 |
28,283 | honeybee/honeybee | src/Model/Aggregate/Entity.php | Entity.getRecordedChanges | protected function getRecordedChanges()
{
$recorded_changes = [];
foreach ($this->getChanges() as $value_changed_event) {
$attribute = $this->getType()->getAttribute($value_changed_event->getAttributeName());
if ($attribute instanceof EmbeddedEntityListAttribute) {
... | php | protected function getRecordedChanges()
{
$recorded_changes = [];
foreach ($this->getChanges() as $value_changed_event) {
$attribute = $this->getType()->getAttribute($value_changed_event->getAttributeName());
if ($attribute instanceof EmbeddedEntityListAttribute) {
... | [
"protected",
"function",
"getRecordedChanges",
"(",
")",
"{",
"$",
"recorded_changes",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"getChanges",
"(",
")",
"as",
"$",
"value_changed_event",
")",
"{",
"$",
"attribute",
"=",
"$",
"this",
"->",
"g... | Returns a list of changes that actually took place, while processing a given event.
@return array | [
"Returns",
"a",
"list",
"of",
"changes",
"that",
"actually",
"took",
"place",
"while",
"processing",
"a",
"given",
"event",
"."
] | 6e46b4f20a0b8a3ce686565440f739960e325a05 | https://github.com/honeybee/honeybee/blob/6e46b4f20a0b8a3ce686565440f739960e325a05/src/Model/Aggregate/Entity.php#L110-L123 |
28,284 | honeybee/honeybee | src/Common/Util/ArrayToolkit.php | ArrayToolkit.mergeScalarSafe | public static function mergeScalarSafe(array &$first, array &$second)
{
$merged = $first;
foreach ($second as $key => &$value) {
if (is_array($value) && isset($merged[$key]) && is_array($merged[$key])) {
$merged[$key] = self::mergeScalarSafe($merged[$key], $value);
... | php | public static function mergeScalarSafe(array &$first, array &$second)
{
$merged = $first;
foreach ($second as $key => &$value) {
if (is_array($value) && isset($merged[$key]) && is_array($merged[$key])) {
$merged[$key] = self::mergeScalarSafe($merged[$key], $value);
... | [
"public",
"static",
"function",
"mergeScalarSafe",
"(",
"array",
"&",
"$",
"first",
",",
"array",
"&",
"$",
"second",
")",
"{",
"$",
"merged",
"=",
"$",
"first",
";",
"foreach",
"(",
"$",
"second",
"as",
"$",
"key",
"=>",
"&",
"$",
"value",
")",
"{... | Merges the given second array over the first one similar to the PHP internal
array_merge_recursive method, but does not change scalar values into arrays
when duplicate keys occur.
@param array $first first or default array
@param array $second array to merge over the first array
@return array merged result with scala... | [
"Merges",
"the",
"given",
"second",
"array",
"over",
"the",
"first",
"one",
"similar",
"to",
"the",
"PHP",
"internal",
"array_merge_recursive",
"method",
"but",
"does",
"not",
"change",
"scalar",
"values",
"into",
"arrays",
"when",
"duplicate",
"keys",
"occur",
... | 6e46b4f20a0b8a3ce686565440f739960e325a05 | https://github.com/honeybee/honeybee/blob/6e46b4f20a0b8a3ce686565440f739960e325a05/src/Common/Util/ArrayToolkit.php#L62-L75 |
28,285 | honeybee/honeybee | src/Projection/EmbeddedEntityType.php | EmbeddedEntityType.getDefaultAttributes | public function getDefaultAttributes()
{
$default_attributes = [
new UuidAttribute('identifier', $this, [], $this->getParentAttribute())
];
$default_attributes_map = new AttributeMap($default_attributes);
return parent::getDefaultAttributes()->append($default_attributes_... | php | public function getDefaultAttributes()
{
$default_attributes = [
new UuidAttribute('identifier', $this, [], $this->getParentAttribute())
];
$default_attributes_map = new AttributeMap($default_attributes);
return parent::getDefaultAttributes()->append($default_attributes_... | [
"public",
"function",
"getDefaultAttributes",
"(",
")",
"{",
"$",
"default_attributes",
"=",
"[",
"new",
"UuidAttribute",
"(",
"'identifier'",
",",
"$",
"this",
",",
"[",
"]",
",",
"$",
"this",
"->",
"getParentAttribute",
"(",
")",
")",
"]",
";",
"$",
"d... | Returns the default attributes that are initially added to a aggregate_type upon creation.
@return AttributeMap A map of AttributeInterface implementations. | [
"Returns",
"the",
"default",
"attributes",
"that",
"are",
"initially",
"added",
"to",
"a",
"aggregate_type",
"upon",
"creation",
"."
] | 6e46b4f20a0b8a3ce686565440f739960e325a05 | https://github.com/honeybee/honeybee/blob/6e46b4f20a0b8a3ce686565440f739960e325a05/src/Projection/EmbeddedEntityType.php#L15-L23 |
28,286 | milejko/mmi | src/Mmi/Mvc/ViewHelper/HeadAbstract.php | HeadAbstract._getLocationTimestamp | protected function _getLocationTimestamp($location)
{
$cacheKey = 'mmi-head-ts-' . md5($location);
$cache = $this->view->getCache();
if (null !== $cache && (null !== ($ts = $cache->load($cacheKey)))) {
return $ts;
}
//obliczanie timestampu
$ts = file_exist... | php | protected function _getLocationTimestamp($location)
{
$cacheKey = 'mmi-head-ts-' . md5($location);
$cache = $this->view->getCache();
if (null !== $cache && (null !== ($ts = $cache->load($cacheKey)))) {
return $ts;
}
//obliczanie timestampu
$ts = file_exist... | [
"protected",
"function",
"_getLocationTimestamp",
"(",
"$",
"location",
")",
"{",
"$",
"cacheKey",
"=",
"'mmi-head-ts-'",
".",
"md5",
"(",
"$",
"location",
")",
";",
"$",
"cache",
"=",
"$",
"this",
"->",
"view",
"->",
"getCache",
"(",
")",
";",
"if",
"... | Pobiera CRC dla danego zasobu lokalnego
@param string $location adres zasobu
@return string | [
"Pobiera",
"CRC",
"dla",
"danego",
"zasobu",
"lokalnego"
] | c1e8dddf83665ad3463ff801074aa2b0875db19b | https://github.com/milejko/mmi/blob/c1e8dddf83665ad3463ff801074aa2b0875db19b/src/Mmi/Mvc/ViewHelper/HeadAbstract.php#L21-L34 |
28,287 | milejko/mmi | src/Mmi/Mvc/ViewHelper/HeadAbstract.php | HeadAbstract._getPublicSrc | protected function _getPublicSrc($src)
{
return $this->view->cdn ? $this->view->cdn . $src : $this->view->baseUrl . $src;
} | php | protected function _getPublicSrc($src)
{
return $this->view->cdn ? $this->view->cdn . $src : $this->view->baseUrl . $src;
} | [
"protected",
"function",
"_getPublicSrc",
"(",
"$",
"src",
")",
"{",
"return",
"$",
"this",
"->",
"view",
"->",
"cdn",
"?",
"$",
"this",
"->",
"view",
"->",
"cdn",
".",
"$",
"src",
":",
"$",
"this",
"->",
"view",
"->",
"baseUrl",
".",
"$",
"src",
... | Zwraca publiczny src z baseUrl i CDN
@param string $src
@return string | [
"Zwraca",
"publiczny",
"src",
"z",
"baseUrl",
"i",
"CDN"
] | c1e8dddf83665ad3463ff801074aa2b0875db19b | https://github.com/milejko/mmi/blob/c1e8dddf83665ad3463ff801074aa2b0875db19b/src/Mmi/Mvc/ViewHelper/HeadAbstract.php#L41-L44 |
28,288 | honeybee/honeybee | src/Model/Aggregate/AggregateRoot.php | AggregateRoot.reconstituteFrom | public function reconstituteFrom(AggregateRootEventList $history)
{
if (!$this->history->isEmpty()) {
throw new ReconstitutionError('Trying to reconstitute history on an already initialized aggregate-root.');
}
$first = true;
foreach ($history as $past_event) {
... | php | public function reconstituteFrom(AggregateRootEventList $history)
{
if (!$this->history->isEmpty()) {
throw new ReconstitutionError('Trying to reconstitute history on an already initialized aggregate-root.');
}
$first = true;
foreach ($history as $past_event) {
... | [
"public",
"function",
"reconstituteFrom",
"(",
"AggregateRootEventList",
"$",
"history",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"history",
"->",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"ReconstitutionError",
"(",
"'Trying to reconstitute history on an... | Rebuild an aggregate-root's latest state based on the given audit log.
@param AggregateRootEventList $history | [
"Rebuild",
"an",
"aggregate",
"-",
"root",
"s",
"latest",
"state",
"based",
"on",
"the",
"given",
"audit",
"log",
"."
] | 6e46b4f20a0b8a3ce686565440f739960e325a05 | https://github.com/honeybee/honeybee/blob/6e46b4f20a0b8a3ce686565440f739960e325a05/src/Model/Aggregate/AggregateRoot.php#L184-L211 |
28,289 | honeybee/honeybee | src/Model/Aggregate/AggregateRoot.php | AggregateRoot.create | public function create(CreateAggregateRootCommand $create_command, StateMachineInterface $state_machine)
{
$initial_data = $this->createInitialData($create_command, $state_machine);
$created_event = $this->processCommand(
$create_command,
[ 'aggregate_root_identifier' => $in... | php | public function create(CreateAggregateRootCommand $create_command, StateMachineInterface $state_machine)
{
$initial_data = $this->createInitialData($create_command, $state_machine);
$created_event = $this->processCommand(
$create_command,
[ 'aggregate_root_identifier' => $in... | [
"public",
"function",
"create",
"(",
"CreateAggregateRootCommand",
"$",
"create_command",
",",
"StateMachineInterface",
"$",
"state_machine",
")",
"{",
"$",
"initial_data",
"=",
"$",
"this",
"->",
"createInitialData",
"(",
"$",
"create_command",
",",
"$",
"state_mac... | Start a new life-cycle for the current aggregate-root.
@param CreateAggregateRootCommand $create_command
@param StateMachineInterface $state_machine | [
"Start",
"a",
"new",
"life",
"-",
"cycle",
"for",
"the",
"current",
"aggregate",
"-",
"root",
"."
] | 6e46b4f20a0b8a3ce686565440f739960e325a05 | https://github.com/honeybee/honeybee/blob/6e46b4f20a0b8a3ce686565440f739960e325a05/src/Model/Aggregate/AggregateRoot.php#L219-L238 |
28,290 | honeybee/honeybee | src/Model/Aggregate/AggregateRoot.php | AggregateRoot.modify | public function modify(ModifyAggregateRootCommand $modify_command)
{
$this->guardCommandPreConditions($modify_command);
$modified_event = $this->processCommand(
$modify_command,
[ 'data' => $modify_command->getValues() ]
);
if (!$modified_event instanceof Ag... | php | public function modify(ModifyAggregateRootCommand $modify_command)
{
$this->guardCommandPreConditions($modify_command);
$modified_event = $this->processCommand(
$modify_command,
[ 'data' => $modify_command->getValues() ]
);
if (!$modified_event instanceof Ag... | [
"public",
"function",
"modify",
"(",
"ModifyAggregateRootCommand",
"$",
"modify_command",
")",
"{",
"$",
"this",
"->",
"guardCommandPreConditions",
"(",
"$",
"modify_command",
")",
";",
"$",
"modified_event",
"=",
"$",
"this",
"->",
"processCommand",
"(",
"$",
"... | Modify the state of the current aggregate-root.
@param ModifyAggregateRootCommand $modify_command | [
"Modify",
"the",
"state",
"of",
"the",
"current",
"aggregate",
"-",
"root",
"."
] | 6e46b4f20a0b8a3ce686565440f739960e325a05 | https://github.com/honeybee/honeybee/blob/6e46b4f20a0b8a3ce686565440f739960e325a05/src/Model/Aggregate/AggregateRoot.php#L245-L264 |
28,291 | honeybee/honeybee | src/Model/Aggregate/AggregateRoot.php | AggregateRoot.createInitialData | protected function createInitialData(
CreateAggregateRootCommand $create_command,
StateMachineInterface $state_machine
) {
$type = $this->getType();
$type_prefix = $type->getPrefix();
$create_data = $create_command->getValues();
$create_data[self::OBJECT_TYPE] = $typ... | php | protected function createInitialData(
CreateAggregateRootCommand $create_command,
StateMachineInterface $state_machine
) {
$type = $this->getType();
$type_prefix = $type->getPrefix();
$create_data = $create_command->getValues();
$create_data[self::OBJECT_TYPE] = $typ... | [
"protected",
"function",
"createInitialData",
"(",
"CreateAggregateRootCommand",
"$",
"create_command",
",",
"StateMachineInterface",
"$",
"state_machine",
")",
"{",
"$",
"type",
"=",
"$",
"this",
"->",
"getType",
"(",
")",
";",
"$",
"type_prefix",
"=",
"$",
"ty... | Create the data used to initialize a new aggregate-root.
@param CreateAggregateRootCommand $create_command
@param StateMachineInterface $state_machine
@return array | [
"Create",
"the",
"data",
"used",
"to",
"initialize",
"a",
"new",
"aggregate",
"-",
"root",
"."
] | 6e46b4f20a0b8a3ce686565440f739960e325a05 | https://github.com/honeybee/honeybee/blob/6e46b4f20a0b8a3ce686565440f739960e325a05/src/Model/Aggregate/AggregateRoot.php#L350-L396 |
28,292 | honeybee/honeybee | src/Model/Aggregate/AggregateRoot.php | AggregateRoot.processCommand | protected function processCommand(AggregateRootTypeCommandInterface $command, array $custom_event_state = [])
{
$event_class = $command->getEventClass();
$default_event_state = [
'metadata' => $command->getMetadata(),
'uuid' => $command->getUuid(),
'seq_number' =>... | php | protected function processCommand(AggregateRootTypeCommandInterface $command, array $custom_event_state = [])
{
$event_class = $command->getEventClass();
$default_event_state = [
'metadata' => $command->getMetadata(),
'uuid' => $command->getUuid(),
'seq_number' =>... | [
"protected",
"function",
"processCommand",
"(",
"AggregateRootTypeCommandInterface",
"$",
"command",
",",
"array",
"$",
"custom_event_state",
"=",
"[",
"]",
")",
"{",
"$",
"event_class",
"=",
"$",
"command",
"->",
"getEventClass",
"(",
")",
";",
"$",
"default_ev... | Process the given command, hence build the corresponding aggregate-root-event.
@param AggregateRootTypeCommandInterface $command
@param array $custom_event_state
@return AggregateRootEventInterface | [
"Process",
"the",
"given",
"command",
"hence",
"build",
"the",
"corresponding",
"aggregate",
"-",
"root",
"-",
"event",
"."
] | 6e46b4f20a0b8a3ce686565440f739960e325a05 | https://github.com/honeybee/honeybee/blob/6e46b4f20a0b8a3ce686565440f739960e325a05/src/Model/Aggregate/AggregateRoot.php#L496-L520 |
28,293 | honeybee/honeybee | src/Model/Aggregate/AggregateRoot.php | AggregateRoot.processEmbeddedEntityCommand | protected function processEmbeddedEntityCommand(CommandInterface $command, array $custom_event_state = [])
{
$event_class = $command->getEventClass();
$attribute_name = $command->getParentAttributeName();
$event_state = [
'parent_attribute_name' => $attribute_name,
'... | php | protected function processEmbeddedEntityCommand(CommandInterface $command, array $custom_event_state = [])
{
$event_class = $command->getEventClass();
$attribute_name = $command->getParentAttributeName();
$event_state = [
'parent_attribute_name' => $attribute_name,
'... | [
"protected",
"function",
"processEmbeddedEntityCommand",
"(",
"CommandInterface",
"$",
"command",
",",
"array",
"$",
"custom_event_state",
"=",
"[",
"]",
")",
"{",
"$",
"event_class",
"=",
"$",
"command",
"->",
"getEventClass",
"(",
")",
";",
"$",
"attribute_nam... | Process the given aggregate-command, hence build the corresponding aggregate-event.
@param CommandInterface $command
@param array $custom_event_state
@return EmbeddedEntityEventInterface | [
"Process",
"the",
"given",
"aggregate",
"-",
"command",
"hence",
"build",
"the",
"corresponding",
"aggregate",
"-",
"event",
"."
] | 6e46b4f20a0b8a3ce686565440f739960e325a05 | https://github.com/honeybee/honeybee/blob/6e46b4f20a0b8a3ce686565440f739960e325a05/src/Model/Aggregate/AggregateRoot.php#L530-L572 |
28,294 | honeybee/honeybee | src/Model/Aggregate/AggregateRoot.php | AggregateRoot.applyEvent | protected function applyEvent(AggregateRootEventInterface $event, $auto_commit = true)
{
$this->guardEventPreConditions($event);
if (!$this->setValues($event->getData())) {
$errors = [];
foreach ($this->getValidationResults() as $validation_result) {
foreach (... | php | protected function applyEvent(AggregateRootEventInterface $event, $auto_commit = true)
{
$this->guardEventPreConditions($event);
if (!$this->setValues($event->getData())) {
$errors = [];
foreach ($this->getValidationResults() as $validation_result) {
foreach (... | [
"protected",
"function",
"applyEvent",
"(",
"AggregateRootEventInterface",
"$",
"event",
",",
"$",
"auto_commit",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"guardEventPreConditions",
"(",
"$",
"event",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"setValues"... | Takes an event and applies the resulting state change to the aggregate-root's internal state.
@param AggregateRootEventInterface $event
@param bool $auto_commit Whether to directly add the given event to the uncomitted-events list.
@return AggregateRootEventInterface Event that is acutally applied and comitted or fal... | [
"Takes",
"an",
"event",
"and",
"applies",
"the",
"resulting",
"state",
"change",
"to",
"the",
"aggregate",
"-",
"root",
"s",
"internal",
"state",
"."
] | 6e46b4f20a0b8a3ce686565440f739960e325a05 | https://github.com/honeybee/honeybee/blob/6e46b4f20a0b8a3ce686565440f739960e325a05/src/Model/Aggregate/AggregateRoot.php#L582-L633 |
28,295 | honeybee/honeybee | src/Model/Aggregate/AggregateRoot.php | AggregateRoot.modifyAttributesThrough | protected function modifyAttributesThrough(AggregateRootCommandInterface $command, array $changing_attributes)
{
$this->guardCommandPreConditions($command);
$this->applyEvent($this->processCommand($command, [ 'data' => $changing_attributes ]));
} | php | protected function modifyAttributesThrough(AggregateRootCommandInterface $command, array $changing_attributes)
{
$this->guardCommandPreConditions($command);
$this->applyEvent($this->processCommand($command, [ 'data' => $changing_attributes ]));
} | [
"protected",
"function",
"modifyAttributesThrough",
"(",
"AggregateRootCommandInterface",
"$",
"command",
",",
"array",
"$",
"changing_attributes",
")",
"{",
"$",
"this",
"->",
"guardCommandPreConditions",
"(",
"$",
"command",
")",
";",
"$",
"this",
"->",
"applyEven... | Helper method, that makes it easier to apply a command in order to achieve a state transition,
that is "just" based on classical attribute changes.
@param AggregateRootCommandInterface $command
@param array $changing_attributes | [
"Helper",
"method",
"that",
"makes",
"it",
"easier",
"to",
"apply",
"a",
"command",
"in",
"order",
"to",
"achieve",
"a",
"state",
"transition",
"that",
"is",
"just",
"based",
"on",
"classical",
"attribute",
"changes",
"."
] | 6e46b4f20a0b8a3ce686565440f739960e325a05 | https://github.com/honeybee/honeybee/blob/6e46b4f20a0b8a3ce686565440f739960e325a05/src/Model/Aggregate/AggregateRoot.php#L642-L646 |
28,296 | milejko/mmi | src/Mmi/Console/Application.php | Application.doRun | public function doRun(InputInterface $input, OutputInterface $output)
{
$env = $input->getParameterOption(['--env', '-e'], 'DEV');
//powołanie aplikacji
$app = new \Mmi\App\Kernel('\Mmi\App\BootstrapCli', $env);
//ustawienie typu odpowiedzi na plain
\Mmi\App\FrontController::... | php | public function doRun(InputInterface $input, OutputInterface $output)
{
$env = $input->getParameterOption(['--env', '-e'], 'DEV');
//powołanie aplikacji
$app = new \Mmi\App\Kernel('\Mmi\App\BootstrapCli', $env);
//ustawienie typu odpowiedzi na plain
\Mmi\App\FrontController::... | [
"public",
"function",
"doRun",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"env",
"=",
"$",
"input",
"->",
"getParameterOption",
"(",
"[",
"'--env'",
",",
"'-e'",
"]",
",",
"'DEV'",
")",
";",
"//powołanie apli... | Bootstrap aplikacji przed wykonaniem komendy konsoli
@param InputInterface $input
@param OutputInterface $output
@return int | [
"Bootstrap",
"aplikacji",
"przed",
"wykonaniem",
"komendy",
"konsoli"
] | c1e8dddf83665ad3463ff801074aa2b0875db19b | https://github.com/milejko/mmi/blob/c1e8dddf83665ad3463ff801074aa2b0875db19b/src/Mmi/Console/Application.php#L31-L42 |
28,297 | milejko/mmi | src/Mmi/Console/Application.php | Application.getApplicationCommands | protected function getApplicationCommands()
{
$commands = [];
foreach (StructureParser::getModules() as $module) {
//namespace modułu
$moduleNamespace = substr($module, strrpos($module, DIRECTORY_SEPARATOR) + 1, strlen($module));
//iteracja po komendach konsolowyc... | php | protected function getApplicationCommands()
{
$commands = [];
foreach (StructureParser::getModules() as $module) {
//namespace modułu
$moduleNamespace = substr($module, strrpos($module, DIRECTORY_SEPARATOR) + 1, strlen($module));
//iteracja po komendach konsolowyc... | [
"protected",
"function",
"getApplicationCommands",
"(",
")",
"{",
"$",
"commands",
"=",
"[",
"]",
";",
"foreach",
"(",
"StructureParser",
"::",
"getModules",
"(",
")",
"as",
"$",
"module",
")",
"{",
"//namespace modułu",
"$",
"moduleNamespace",
"=",
"substr",
... | Pobieranie komend z aplikacji | [
"Pobieranie",
"komend",
"z",
"aplikacji"
] | c1e8dddf83665ad3463ff801074aa2b0875db19b | https://github.com/milejko/mmi/blob/c1e8dddf83665ad3463ff801074aa2b0875db19b/src/Mmi/Console/Application.php#L55-L77 |
28,298 | milejko/mmi | src/Mmi/Log/LoggerHelper.php | LoggerHelper.getLevel | public static function getLevel()
{
if (!self::$_config) {
throw new LoggerException('Configuration not loaded');
}
$minLevel = Logger::EMERGENCY;
//iteracja po configach
foreach (self::$_config as $config) {
if ($config->getLevel() < $minLevel) {
... | php | public static function getLevel()
{
if (!self::$_config) {
throw new LoggerException('Configuration not loaded');
}
$minLevel = Logger::EMERGENCY;
//iteracja po configach
foreach (self::$_config as $config) {
if ($config->getLevel() < $minLevel) {
... | [
"public",
"static",
"function",
"getLevel",
"(",
")",
"{",
"if",
"(",
"!",
"self",
"::",
"$",
"_config",
")",
"{",
"throw",
"new",
"LoggerException",
"(",
"'Configuration not loaded'",
")",
";",
"}",
"$",
"minLevel",
"=",
"Logger",
"::",
"EMERGENCY",
";",
... | Zwraca poziom logowania
@return integer | [
"Zwraca",
"poziom",
"logowania"
] | c1e8dddf83665ad3463ff801074aa2b0875db19b | https://github.com/milejko/mmi/blob/c1e8dddf83665ad3463ff801074aa2b0875db19b/src/Mmi/Log/LoggerHelper.php#L47-L60 |
28,299 | peakphp/framework | src/Collection/DotNotationCollection.php | DotNotationCollection.get | public function get(string $path, $default = null)
{
$array = $this->items;
if (!empty($path)) {
$keys = $this->explode($path);
foreach ($keys as $key) {
if (!array_key_exists($key, $array)) {
return $default;
}
... | php | public function get(string $path, $default = null)
{
$array = $this->items;
if (!empty($path)) {
$keys = $this->explode($path);
foreach ($keys as $key) {
if (!array_key_exists($key, $array)) {
return $default;
}
... | [
"public",
"function",
"get",
"(",
"string",
"$",
"path",
",",
"$",
"default",
"=",
"null",
")",
"{",
"$",
"array",
"=",
"$",
"this",
"->",
"items",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"path",
")",
")",
"{",
"$",
"keys",
"=",
"$",
"this",
... | Return a path value
@param string $path
@param mixed $default
@return mixed | [
"Return",
"a",
"path",
"value"
] | 412c13c2a0f165ee645eb3636f23a74a81429d3a | https://github.com/peakphp/framework/blob/412c13c2a0f165ee645eb3636f23a74a81429d3a/src/Collection/DotNotationCollection.php#L29-L44 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.