repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
mgallegos/decima-file | src/Mgallegos/DecimaFile/File/Services/FileManagement/FileManager.php | FileManager.create | public function create(array $input, $openTransaction = true, $databaseConnectionName = null, $organizationId = null, $loggedUserId = null)
{
unset($input['_token'] , $input['parent_label']);
if(empty($organizationId))
{
$organizationId = $this->AuthenticationManager->getCurrentUserOrganizationId()... | php | public function create(array $input, $openTransaction = true, $databaseConnectionName = null, $organizationId = null, $loggedUserId = null)
{
unset($input['_token'] , $input['parent_label']);
if(empty($organizationId))
{
$organizationId = $this->AuthenticationManager->getCurrentUserOrganizationId()... | [
"public",
"function",
"create",
"(",
"array",
"$",
"input",
",",
"$",
"openTransaction",
"=",
"true",
",",
"$",
"databaseConnectionName",
"=",
"null",
",",
"$",
"organizationId",
"=",
"null",
",",
"$",
"loggedUserId",
"=",
"null",
")",
"{",
"unset",
"(",
... | Create a new ...
@param array $input
An array as follows: array('field0'=>$field0, 'field1'=>$field1
);
@return JSON encoded string
A string as follows:
In case of success: {"success" : form.defaultSuccessSaveMessage} | [
"Create",
"a",
"new",
"..."
] | train | https://github.com/mgallegos/decima-file/blob/94c26ab40f5c4dd12e913e73376c24db27588f0b/src/Mgallegos/DecimaFile/File/Services/FileManagement/FileManager.php#L808-L862 |
mgallegos/decima-file | src/Mgallegos/DecimaFile/File/Services/FileManagement/FileManager.php | FileManager.delete | public function delete(array $input, $openTransaction = true, $databaseConnectionName = null, $organizationId = null, $loggedUserId = null)
{
unset($input['_token']);
if(empty($organizationId))
{
$organizationId = $this->AuthenticationManager->getCurrentUserOrganizationId();
}
if(em... | php | public function delete(array $input, $openTransaction = true, $databaseConnectionName = null, $organizationId = null, $loggedUserId = null)
{
unset($input['_token']);
if(empty($organizationId))
{
$organizationId = $this->AuthenticationManager->getCurrentUserOrganizationId();
}
if(em... | [
"public",
"function",
"delete",
"(",
"array",
"$",
"input",
",",
"$",
"openTransaction",
"=",
"true",
",",
"$",
"databaseConnectionName",
"=",
"null",
",",
"$",
"organizationId",
"=",
"null",
",",
"$",
"loggedUserId",
"=",
"null",
")",
"{",
"unset",
"(",
... | Delete existing ... (soft delete)
@param array $input
An array as follows: array($id0, $id1,…);
@return JSON encoded string
A string as follows:
In case of success: {"success" : form.defaultSuccessDeleteMessage} | [
"Delete",
"existing",
"...",
"(",
"soft",
"delete",
")"
] | train | https://github.com/mgallegos/decima-file/blob/94c26ab40f5c4dd12e913e73376c24db27588f0b/src/Mgallegos/DecimaFile/File/Services/FileManagement/FileManager.php#L928-L977 |
mgallegos/decima-file | src/Mgallegos/DecimaFile/File/Services/FileManagement/FileManager.php | FileManager.serveFile | public function serveFile($type, $route, $filename)
{
if($type == 'image')
{
return $this->Response->make($this->Storage->read($route))->header('Content-Type', 'image');
}
else if($type == 'pdf')
{
return $this->Response->make($this->Storage->read($route))->header('Content-Type', 'appl... | php | public function serveFile($type, $route, $filename)
{
if($type == 'image')
{
return $this->Response->make($this->Storage->read($route))->header('Content-Type', 'image');
}
else if($type == 'pdf')
{
return $this->Response->make($this->Storage->read($route))->header('Content-Type', 'appl... | [
"public",
"function",
"serveFile",
"(",
"$",
"type",
",",
"$",
"route",
",",
"$",
"filename",
")",
"{",
"if",
"(",
"$",
"type",
"==",
"'image'",
")",
"{",
"return",
"$",
"this",
"->",
"Response",
"->",
"make",
"(",
"$",
"this",
"->",
"Storage",
"->... | Serve public file
@param string $key
@return Response | [
"Serve",
"public",
"file"
] | train | https://github.com/mgallegos/decima-file/blob/94c26ab40f5c4dd12e913e73376c24db27588f0b/src/Mgallegos/DecimaFile/File/Services/FileManagement/FileManager.php#L1003-L1056 |
mgallegos/decima-file | src/Mgallegos/DecimaFile/File/Services/FileManagement/FileManager.php | FileManager.servePublicFile | public function servePublicFile($key)
{
$SecurityFile = $this->SecurityFile->byKey($key)->first();
if(!is_null($SecurityFile))
{
$File = $this->File->byKeyAndPublicWithConnectionName($key, true, $SecurityFile->organization->database_connection_name)->first();
}
else
{
$File = $thi... | php | public function servePublicFile($key)
{
$SecurityFile = $this->SecurityFile->byKey($key)->first();
if(!is_null($SecurityFile))
{
$File = $this->File->byKeyAndPublicWithConnectionName($key, true, $SecurityFile->organization->database_connection_name)->first();
}
else
{
$File = $thi... | [
"public",
"function",
"servePublicFile",
"(",
"$",
"key",
")",
"{",
"$",
"SecurityFile",
"=",
"$",
"this",
"->",
"SecurityFile",
"->",
"byKey",
"(",
"$",
"key",
")",
"->",
"first",
"(",
")",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"SecurityFile",
"... | Serve public file
@param string $key
@return Response | [
"Serve",
"public",
"file"
] | train | https://github.com/mgallegos/decima-file/blob/94c26ab40f5c4dd12e913e73376c24db27588f0b/src/Mgallegos/DecimaFile/File/Services/FileManagement/FileManager.php#L1065-L1084 |
mgallegos/decima-file | src/Mgallegos/DecimaFile/File/Services/FileManagement/FileManager.php | FileManager.servePrivateFile | public function servePrivateFile($key)
{
$File = $this->File->byKeyAndPublic($key , false)->first();
if(!is_null($File))
{
return $this->serveFile($File->system_type, $File->system_route, $File->name);
}
return $this->Redirector->to($this->AppManager->getErrorPageUrl())->withError($this->L... | php | public function servePrivateFile($key)
{
$File = $this->File->byKeyAndPublic($key , false)->first();
if(!is_null($File))
{
return $this->serveFile($File->system_type, $File->system_route, $File->name);
}
return $this->Redirector->to($this->AppManager->getErrorPageUrl())->withError($this->L... | [
"public",
"function",
"servePrivateFile",
"(",
"$",
"key",
")",
"{",
"$",
"File",
"=",
"$",
"this",
"->",
"File",
"->",
"byKeyAndPublic",
"(",
"$",
"key",
",",
"false",
")",
"->",
"first",
"(",
")",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"File",... | Serve private file
@param string $key
@return Response | [
"Serve",
"private",
"file"
] | train | https://github.com/mgallegos/decima-file/blob/94c26ab40f5c4dd12e913e73376c24db27588f0b/src/Mgallegos/DecimaFile/File/Services/FileManagement/FileManager.php#L1093-L1103 |
yuncms/framework | src/filesystem/FilesystemAdapter.php | FilesystemAdapter.putFile | public function putFile($path, $file, $options = [])
{
return $this->putFileAs($path, $file, $file->getRename(), $options);
} | php | public function putFile($path, $file, $options = [])
{
return $this->putFileAs($path, $file, $file->getRename(), $options);
} | [
"public",
"function",
"putFile",
"(",
"$",
"path",
",",
"$",
"file",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"putFileAs",
"(",
"$",
"path",
",",
"$",
"file",
",",
"$",
"file",
"->",
"getRename",
"(",
")",
",",
... | Store the uploaded file on the disk.
@param string $path
@param \yuncms\web\UploadedFile $file
@param array $options
@return string|false | [
"Store",
"the",
"uploaded",
"file",
"on",
"the",
"disk",
"."
] | train | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/filesystem/FilesystemAdapter.php#L112-L115 |
yuncms/framework | src/filesystem/FilesystemAdapter.php | FilesystemAdapter.getVisibility | public function getVisibility($path)
{
if ($this->driver->getVisibility($path) == AdapterInterface::VISIBILITY_PUBLIC) {
return Filesystem::VISIBILITY_PUBLIC;
}
return Filesystem::VISIBILITY_PRIVATE;
} | php | public function getVisibility($path)
{
if ($this->driver->getVisibility($path) == AdapterInterface::VISIBILITY_PUBLIC) {
return Filesystem::VISIBILITY_PUBLIC;
}
return Filesystem::VISIBILITY_PRIVATE;
} | [
"public",
"function",
"getVisibility",
"(",
"$",
"path",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"driver",
"->",
"getVisibility",
"(",
"$",
"path",
")",
"==",
"AdapterInterface",
"::",
"VISIBILITY_PUBLIC",
")",
"{",
"return",
"Filesystem",
"::",
"VISIBILITY_... | 获取文件的可见性属性
@param string $path
@return string
@throws FileNotFoundException | [
"获取文件的可见性属性"
] | train | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/filesystem/FilesystemAdapter.php#L151-L157 |
yuncms/framework | src/filesystem/FilesystemAdapter.php | FilesystemAdapter.url | public function url($path)
{
$adapter = $this->driver->getAdapter();
if ($adapter instanceof CachedAdapter) {
$adapter = $adapter->getAdapter();
}
if (method_exists($adapter, 'getUrl')) {
return $adapter->getUrl($path);
} elseif ($adapter instanceof ... | php | public function url($path)
{
$adapter = $this->driver->getAdapter();
if ($adapter instanceof CachedAdapter) {
$adapter = $adapter->getAdapter();
}
if (method_exists($adapter, 'getUrl')) {
return $adapter->getUrl($path);
} elseif ($adapter instanceof ... | [
"public",
"function",
"url",
"(",
"$",
"path",
")",
"{",
"$",
"adapter",
"=",
"$",
"this",
"->",
"driver",
"->",
"getAdapter",
"(",
")",
";",
"if",
"(",
"$",
"adapter",
"instanceof",
"CachedAdapter",
")",
"{",
"$",
"adapter",
"=",
"$",
"adapter",
"->... | 获取文件访问Url
@param string $path
@return string
@throws \OSS\Core\OssException | [
"获取文件访问Url"
] | train | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/filesystem/FilesystemAdapter.php#L301-L320 |
yuncms/framework | src/filesystem/FilesystemAdapter.php | FilesystemAdapter.getLocalUrl | protected function getLocalUrl($path)
{
$config = $this->driver->getConfig();
// If an explicit base URL has been set on the disk configuration then we will use
// it as the base URL instead of the default path. This allows the developer to
// have full control over the base path fo... | php | protected function getLocalUrl($path)
{
$config = $this->driver->getConfig();
// If an explicit base URL has been set on the disk configuration then we will use
// it as the base URL instead of the default path. This allows the developer to
// have full control over the base path fo... | [
"protected",
"function",
"getLocalUrl",
"(",
"$",
"path",
")",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"driver",
"->",
"getConfig",
"(",
")",
";",
"// If an explicit base URL has been set on the disk configuration then we will use",
"// it as the base URL instead of the... | Get the URL for the file at the given path.
@param string $path
@return string | [
"Get",
"the",
"URL",
"for",
"the",
"file",
"at",
"the",
"given",
"path",
"."
] | train | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/filesystem/FilesystemAdapter.php#L328-L349 |
yuncms/framework | src/filesystem/FilesystemAdapter.php | FilesystemAdapter.temporaryUrl | public function temporaryUrl($path, $expiration, array $options = [])
{
$adapter = $this->driver->getAdapter();
if ($adapter instanceof CachedAdapter) {
$adapter = $adapter->getAdapter();
}
if (method_exists($adapter, 'getTemporaryUrl')) {
return $adapter->g... | php | public function temporaryUrl($path, $expiration, array $options = [])
{
$adapter = $this->driver->getAdapter();
if ($adapter instanceof CachedAdapter) {
$adapter = $adapter->getAdapter();
}
if (method_exists($adapter, 'getTemporaryUrl')) {
return $adapter->g... | [
"public",
"function",
"temporaryUrl",
"(",
"$",
"path",
",",
"$",
"expiration",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"adapter",
"=",
"$",
"this",
"->",
"driver",
"->",
"getAdapter",
"(",
")",
";",
"if",
"(",
"$",
"adapter",
"... | 获取文件的临时访问Url
@param string $path
@param \DateTimeInterface $expiration
@param array $options
@return string | [
"获取文件的临时访问Url"
] | train | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/filesystem/FilesystemAdapter.php#L397-L412 |
yuncms/framework | src/filesystem/FilesystemAdapter.php | FilesystemAdapter.parseVisibility | protected function parseVisibility($visibility)
{
if (is_null($visibility)) {
return;
}
switch ($visibility) {
case Filesystem::VISIBILITY_PUBLIC:
return AdapterInterface::VISIBILITY_PUBLIC;
case Filesystem::VISIBILITY_PRIVATE:
... | php | protected function parseVisibility($visibility)
{
if (is_null($visibility)) {
return;
}
switch ($visibility) {
case Filesystem::VISIBILITY_PUBLIC:
return AdapterInterface::VISIBILITY_PUBLIC;
case Filesystem::VISIBILITY_PRIVATE:
... | [
"protected",
"function",
"parseVisibility",
"(",
"$",
"visibility",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"visibility",
")",
")",
"{",
"return",
";",
"}",
"switch",
"(",
"$",
"visibility",
")",
"{",
"case",
"Filesystem",
"::",
"VISIBILITY_PUBLIC",
":",... | 解析可见性值
@param string|null $visibility
@return string
@throws InvalidArgumentException | [
"解析可见性值"
] | train | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/filesystem/FilesystemAdapter.php#L502-L515 |
ruvents/ruwork-upload-bundle | Form/Type/DoctrineUploadType.php | DoctrineUploadType.configureOptions | public function configureOptions(OptionsResolver $resolver): void
{
$resolver
->setDefaults([
'finder' => function (Options $options): callable {
$class = $options['class'];
return function (string $path) use ($class) {
... | php | public function configureOptions(OptionsResolver $resolver): void
{
$resolver
->setDefaults([
'finder' => function (Options $options): callable {
$class = $options['class'];
return function (string $path) use ($class) {
... | [
"public",
"function",
"configureOptions",
"(",
"OptionsResolver",
"$",
"resolver",
")",
":",
"void",
"{",
"$",
"resolver",
"->",
"setDefaults",
"(",
"[",
"'finder'",
"=>",
"function",
"(",
"Options",
"$",
"options",
")",
":",
"callable",
"{",
"$",
"class",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/ruvents/ruwork-upload-bundle/blob/8ad09cc2dce6ab389105c440d791346696da43af/Form/Type/DoctrineUploadType.php#L29-L63 |
fond-of/spryker-brand | src/FondOfSpryker/Zed/Brand/Communication/Console/BrandConsole.php | BrandConsole.execute | protected function execute(InputInterface $input, OutputInterface $output)
{
// single
$single = 2;
if ($single === 1) {
$brandTransfer = new BrandTransfer();
$brandTransfer->setName('pinqponq');
$brandTransfer = $this->getFacade()->getBrand($brandTransfe... | php | protected function execute(InputInterface $input, OutputInterface $output)
{
// single
$single = 2;
if ($single === 1) {
$brandTransfer = new BrandTransfer();
$brandTransfer->setName('pinqponq');
$brandTransfer = $this->getFacade()->getBrand($brandTransfe... | [
"protected",
"function",
"execute",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"// single",
"$",
"single",
"=",
"2",
";",
"if",
"(",
"$",
"single",
"===",
"1",
")",
"{",
"$",
"brandTransfer",
"=",
"new",
"BrandT... | @param \Symfony\Component\Console\Input\InputInterface $input
@param \Symfony\Component\Console\Output\OutputInterface $output
@return int | [
"@param",
"\\",
"Symfony",
"\\",
"Component",
"\\",
"Console",
"\\",
"Input",
"\\",
"InputInterface",
"$input",
"@param",
"\\",
"Symfony",
"\\",
"Component",
"\\",
"Console",
"\\",
"Output",
"\\",
"OutputInterface",
"$output"
] | train | https://github.com/fond-of/spryker-brand/blob/0ae25c381649b70845016606de9cf4e7dfdccffa/src/FondOfSpryker/Zed/Brand/Communication/Console/BrandConsole.php#L39-L63 |
fond-of/spryker-brand | src/FondOfSpryker/Zed/Brand/Communication/Console/BrandConsole.php | BrandConsole.printBrand | protected function printBrand(BrandTransfer $brandTransfer, OutputInterface $output): void
{
$output->writeln($brandTransfer->getName() . ' ' . $brandTransfer->getB2cUrlShop());
$output->writeln('--------');
} | php | protected function printBrand(BrandTransfer $brandTransfer, OutputInterface $output): void
{
$output->writeln($brandTransfer->getName() . ' ' . $brandTransfer->getB2cUrlShop());
$output->writeln('--------');
} | [
"protected",
"function",
"printBrand",
"(",
"BrandTransfer",
"$",
"brandTransfer",
",",
"OutputInterface",
"$",
"output",
")",
":",
"void",
"{",
"$",
"output",
"->",
"writeln",
"(",
"$",
"brandTransfer",
"->",
"getName",
"(",
")",
".",
"' '",
".",
"$",
"br... | @param \Generated\Shared\Transfer\BrandTransfer $brandTransfer
@param \Symfony\Component\Console\Output\OutputInterface $output
@return void | [
"@param",
"\\",
"Generated",
"\\",
"Shared",
"\\",
"Transfer",
"\\",
"BrandTransfer",
"$brandTransfer",
"@param",
"\\",
"Symfony",
"\\",
"Component",
"\\",
"Console",
"\\",
"Output",
"\\",
"OutputInterface",
"$output"
] | train | https://github.com/fond-of/spryker-brand/blob/0ae25c381649b70845016606de9cf4e7dfdccffa/src/FondOfSpryker/Zed/Brand/Communication/Console/BrandConsole.php#L71-L75 |
titon/db | src/Titon/Db/Driver/AbstractPdoDriver.php | AbstractPdoDriver.buildStatement | public function buildStatement(Query $query) {
$type = $query->getType();
$method = 'build' . ucfirst($type);
$dialect = $this->getDialect();
if (!method_exists($dialect, $method)) {
throw new UnsupportedQueryStatementException(sprintf('Query statement %s does not exist or h... | php | public function buildStatement(Query $query) {
$type = $query->getType();
$method = 'build' . ucfirst($type);
$dialect = $this->getDialect();
if (!method_exists($dialect, $method)) {
throw new UnsupportedQueryStatementException(sprintf('Query statement %s does not exist or h... | [
"public",
"function",
"buildStatement",
"(",
"Query",
"$",
"query",
")",
"{",
"$",
"type",
"=",
"$",
"query",
"->",
"getType",
"(",
")",
";",
"$",
"method",
"=",
"'build'",
".",
"ucfirst",
"(",
"$",
"type",
")",
";",
"$",
"dialect",
"=",
"$",
"this... | {@inheritdoc}
@throws \Titon\Db\Exception\UnsupportedQueryStatementException | [
"{",
"@inheritdoc",
"}"
] | train | https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Driver/AbstractPdoDriver.php#L54-L64 |
titon/db | src/Titon/Db/Driver/AbstractPdoDriver.php | AbstractPdoDriver.connect | public function connect() {
if ($this->isConnected()) {
return true;
}
// @codeCoverageIgnoreStart
if (!$this->isEnabled()) {
throw new MissingDriverException(sprintf('%s driver extension is not enabled', $this->getDriver()));
}
// @codeCoverageIg... | php | public function connect() {
if ($this->isConnected()) {
return true;
}
// @codeCoverageIgnoreStart
if (!$this->isEnabled()) {
throw new MissingDriverException(sprintf('%s driver extension is not enabled', $this->getDriver()));
}
// @codeCoverageIg... | [
"public",
"function",
"connect",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isConnected",
"(",
")",
")",
"{",
"return",
"true",
";",
"}",
"// @codeCoverageIgnoreStart",
"if",
"(",
"!",
"$",
"this",
"->",
"isEnabled",
"(",
")",
")",
"{",
"throw",
"... | Connect to the database using PDO.
@return bool
@throws \Titon\Db\Exception\MissingDriverException | [
"Connect",
"to",
"the",
"database",
"using",
"PDO",
"."
] | train | https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Driver/AbstractPdoDriver.php#L72-L89 |
titon/db | src/Titon/Db/Driver/AbstractPdoDriver.php | AbstractPdoDriver.commitTransaction | public function commitTransaction() {
if ($this->_transactions === 1) {
$this->logQuery(new SqlResultSet('COMMIT'));
$status = $this->getConnection()->commit();
} else {
$status = true;
}
$this->_transactions--;
return $status;
} | php | public function commitTransaction() {
if ($this->_transactions === 1) {
$this->logQuery(new SqlResultSet('COMMIT'));
$status = $this->getConnection()->commit();
} else {
$status = true;
}
$this->_transactions--;
return $status;
} | [
"public",
"function",
"commitTransaction",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_transactions",
"===",
"1",
")",
"{",
"$",
"this",
"->",
"logQuery",
"(",
"new",
"SqlResultSet",
"(",
"'COMMIT'",
")",
")",
";",
"$",
"status",
"=",
"$",
"this",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Driver/AbstractPdoDriver.php#L94-L106 |
titon/db | src/Titon/Db/Driver/AbstractPdoDriver.php | AbstractPdoDriver.describeTable | public function describeTable($table) {
return $this->cacheQuery([__METHOD__, $table], function(AbstractPdoDriver $driver) use ($table) {
$columns = $driver->executeQuery('SELECT * FROM information_schema.columns WHERE table_schema = ? AND table_name = ?;', [$driver->getDatabase(), $table])->find();... | php | public function describeTable($table) {
return $this->cacheQuery([__METHOD__, $table], function(AbstractPdoDriver $driver) use ($table) {
$columns = $driver->executeQuery('SELECT * FROM information_schema.columns WHERE table_schema = ? AND table_name = ?;', [$driver->getDatabase(), $table])->find();... | [
"public",
"function",
"describeTable",
"(",
"$",
"table",
")",
"{",
"return",
"$",
"this",
"->",
"cacheQuery",
"(",
"[",
"__METHOD__",
",",
"$",
"table",
"]",
",",
"function",
"(",
"AbstractPdoDriver",
"$",
"driver",
")",
"use",
"(",
"$",
"table",
")",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Driver/AbstractPdoDriver.php#L111-L171 |
titon/db | src/Titon/Db/Driver/AbstractPdoDriver.php | AbstractPdoDriver.escape | public function escape($value) {
if ($value === null) {
return 'NULL';
}
return $this->getConnection()->quote($value, $this->resolveType($value));
} | php | public function escape($value) {
if ($value === null) {
return 'NULL';
}
return $this->getConnection()->quote($value, $this->resolveType($value));
} | [
"public",
"function",
"escape",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"===",
"null",
")",
"{",
"return",
"'NULL'",
";",
"}",
"return",
"$",
"this",
"->",
"getConnection",
"(",
")",
"->",
"quote",
"(",
"$",
"value",
",",
"$",
"this",... | {@inheritdoc} | [
"{"
] | train | https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Driver/AbstractPdoDriver.php#L176-L182 |
titon/db | src/Titon/Db/Driver/AbstractPdoDriver.php | AbstractPdoDriver.executeQuery | public function executeQuery($query, array $params = []) {
$this->connect();
$cacheKey = null;
$cacheLength = null;
// Determine cache key and lengths
if ($query instanceof Query) {
$cacheKey = $query->getCacheKey();
$cacheLength = $query->getCacheLength... | php | public function executeQuery($query, array $params = []) {
$this->connect();
$cacheKey = null;
$cacheLength = null;
// Determine cache key and lengths
if ($query instanceof Query) {
$cacheKey = $query->getCacheKey();
$cacheLength = $query->getCacheLength... | [
"public",
"function",
"executeQuery",
"(",
"$",
"query",
",",
"array",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"connect",
"(",
")",
";",
"$",
"cacheKey",
"=",
"null",
";",
"$",
"cacheLength",
"=",
"null",
";",
"// Determine cache key... | {@inheritdoc}
@throws \Titon\Db\Exception\InvalidQueryException | [
"{",
"@inheritdoc",
"}"
] | train | https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Driver/AbstractPdoDriver.php#L189-L239 |
titon/db | src/Titon/Db/Driver/AbstractPdoDriver.php | AbstractPdoDriver.resolveBind | public function resolveBind($field, $value, array $schema = []) {
$type = null;
// Exit early for functions since we don't have a valid field
if ($field instanceof Func) {
return [$value, $this->resolveType($value)];
}
// Use the raw value for binding
if ($v... | php | public function resolveBind($field, $value, array $schema = []) {
$type = null;
// Exit early for functions since we don't have a valid field
if ($field instanceof Func) {
return [$value, $this->resolveType($value)];
}
// Use the raw value for binding
if ($v... | [
"public",
"function",
"resolveBind",
"(",
"$",
"field",
",",
"$",
"value",
",",
"array",
"$",
"schema",
"=",
"[",
"]",
")",
"{",
"$",
"type",
"=",
"null",
";",
"// Exit early for functions since we don't have a valid field",
"if",
"(",
"$",
"field",
"instanceo... | Resolve the bind value and the PDO binding type.
@param string $field
@param mixed $value
@param array $schema
@return array | [
"Resolve",
"the",
"bind",
"value",
"and",
"the",
"PDO",
"binding",
"type",
"."
] | train | https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Driver/AbstractPdoDriver.php#L334-L363 |
titon/db | src/Titon/Db/Driver/AbstractPdoDriver.php | AbstractPdoDriver.resolveParams | public function resolveParams(Query $query) {
$params = [];
$schema = $query->getRepository()->getSchema()->getColumns();
foreach ($query->getGroupedBindings() as $groupedBinds) {
foreach ($groupedBinds as $binds) {
$params[] = $this->resolveBind($binds['field'], $bi... | php | public function resolveParams(Query $query) {
$params = [];
$schema = $query->getRepository()->getSchema()->getColumns();
foreach ($query->getGroupedBindings() as $groupedBinds) {
foreach ($groupedBinds as $binds) {
$params[] = $this->resolveBind($binds['field'], $bi... | [
"public",
"function",
"resolveParams",
"(",
"Query",
"$",
"query",
")",
"{",
"$",
"params",
"=",
"[",
"]",
";",
"$",
"schema",
"=",
"$",
"query",
"->",
"getRepository",
"(",
")",
"->",
"getSchema",
"(",
")",
"->",
"getColumns",
"(",
")",
";",
"foreac... | Resolve the list of values that will be required for PDO statement binding.
@param \Titon\Db\Query $query
@return array | [
"Resolve",
"the",
"list",
"of",
"values",
"that",
"will",
"be",
"required",
"for",
"PDO",
"statement",
"binding",
"."
] | train | https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Driver/AbstractPdoDriver.php#L371-L386 |
titon/db | src/Titon/Db/Driver/AbstractPdoDriver.php | AbstractPdoDriver.resolveType | public function resolveType($value) {
if ($value === null) {
$type = PDO::PARAM_NULL;
} else if (is_resource($value)) {
$type = PDO::PARAM_LOB;
} else if (is_numeric($value)) {
if (is_float($value) || is_double($value)) {
$type = PDO::PARAM_S... | php | public function resolveType($value) {
if ($value === null) {
$type = PDO::PARAM_NULL;
} else if (is_resource($value)) {
$type = PDO::PARAM_LOB;
} else if (is_numeric($value)) {
if (is_float($value) || is_double($value)) {
$type = PDO::PARAM_S... | [
"public",
"function",
"resolveType",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"===",
"null",
")",
"{",
"$",
"type",
"=",
"PDO",
"::",
"PARAM_NULL",
";",
"}",
"else",
"if",
"(",
"is_resource",
"(",
"$",
"value",
")",
")",
"{",
"$",
"t... | Resolve the value type for PDO parameter binding and quoting.
@param mixed $value
@return int | [
"Resolve",
"the",
"value",
"type",
"for",
"PDO",
"parameter",
"binding",
"and",
"quoting",
"."
] | train | https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Driver/AbstractPdoDriver.php#L394-L417 |
titon/db | src/Titon/Db/Driver/AbstractPdoDriver.php | AbstractPdoDriver.rollbackTransaction | public function rollbackTransaction() {
if ($this->_transactions === 1) {
$this->logQuery(new SqlResultSet('ROLLBACK'));
$status = $this->getConnection()->rollBack();
$this->_transactions = 0;
} else {
$status = true;
$this->_transactions--... | php | public function rollbackTransaction() {
if ($this->_transactions === 1) {
$this->logQuery(new SqlResultSet('ROLLBACK'));
$status = $this->getConnection()->rollBack();
$this->_transactions = 0;
} else {
$status = true;
$this->_transactions--... | [
"public",
"function",
"rollbackTransaction",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_transactions",
"===",
"1",
")",
"{",
"$",
"this",
"->",
"logQuery",
"(",
"new",
"SqlResultSet",
"(",
"'ROLLBACK'",
")",
")",
";",
"$",
"status",
"=",
"$",
"this... | {@inheritdoc} | [
"{"
] | train | https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Driver/AbstractPdoDriver.php#L422-L437 |
titon/db | src/Titon/Db/Driver/AbstractPdoDriver.php | AbstractPdoDriver.startTransaction | public function startTransaction() {
if (!$this->_transactions) {
$this->logQuery(new SqlResultSet('BEGIN'));
$status = $this->getConnection()->beginTransaction();
} else {
$status = true;
}
$this->_transactions++;
return $status;
} | php | public function startTransaction() {
if (!$this->_transactions) {
$this->logQuery(new SqlResultSet('BEGIN'));
$status = $this->getConnection()->beginTransaction();
} else {
$status = true;
}
$this->_transactions++;
return $status;
} | [
"public",
"function",
"startTransaction",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_transactions",
")",
"{",
"$",
"this",
"->",
"logQuery",
"(",
"new",
"SqlResultSet",
"(",
"'BEGIN'",
")",
")",
";",
"$",
"status",
"=",
"$",
"this",
"->",
"g... | {@inheritdoc} | [
"{"
] | train | https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Driver/AbstractPdoDriver.php#L442-L454 |
drsdre/yii2-xmlsoccer | migrations/m180312_095716_init.php | m180312_095716_init.safeUp | public function safeUp()
{
$this->createTable('{{%goal}}', [
'id' => $this->primaryKey(10)->unsigned(),
'team_id' => $this->integer(10)->unsigned()->notNull(),
'player_id' => $this->integer(10)->unsigned()->null()->defaultValue(null),
'match_id' => $this->inte... | php | public function safeUp()
{
$this->createTable('{{%goal}}', [
'id' => $this->primaryKey(10)->unsigned(),
'team_id' => $this->integer(10)->unsigned()->notNull(),
'player_id' => $this->integer(10)->unsigned()->null()->defaultValue(null),
'match_id' => $this->inte... | [
"public",
"function",
"safeUp",
"(",
")",
"{",
"$",
"this",
"->",
"createTable",
"(",
"'{{%goal}}'",
",",
"[",
"'id'",
"=>",
"$",
"this",
"->",
"primaryKey",
"(",
"10",
")",
"->",
"unsigned",
"(",
")",
",",
"'team_id'",
"=>",
"$",
"this",
"->",
"inte... | {@inheritdoc} | [
"{"
] | train | https://github.com/drsdre/yii2-xmlsoccer/blob/a746edee6269ed0791bac6c6165a946adc30d994/migrations/m180312_095716_init.php#L27-L192 |
drsdre/yii2-xmlsoccer | migrations/m180312_095716_init.php | m180312_095716_init.safeDown | public function safeDown()
{
$this->dropForeignKey('{{%player_ibfk_1}}', '{{%player}}');
$this->dropForeignKey('{{%player_ibfk_2}}', '{{%player}}');
$this->dropForeignKey('{{%match_ibfk_1}}', '{{%match}}');
$this->dropForeignKey('{{%match_ibfk_2}}', '{{%match}}');
$this->drop... | php | public function safeDown()
{
$this->dropForeignKey('{{%player_ibfk_1}}', '{{%player}}');
$this->dropForeignKey('{{%player_ibfk_2}}', '{{%player}}');
$this->dropForeignKey('{{%match_ibfk_1}}', '{{%match}}');
$this->dropForeignKey('{{%match_ibfk_2}}', '{{%match}}');
$this->drop... | [
"public",
"function",
"safeDown",
"(",
")",
"{",
"$",
"this",
"->",
"dropForeignKey",
"(",
"'{{%player_ibfk_1}}'",
",",
"'{{%player}}'",
")",
";",
"$",
"this",
"->",
"dropForeignKey",
"(",
"'{{%player_ibfk_2}}'",
",",
"'{{%player}}'",
")",
";",
"$",
"this",
"-... | {@inheritdoc} | [
"{"
] | train | https://github.com/drsdre/yii2-xmlsoccer/blob/a746edee6269ed0791bac6c6165a946adc30d994/migrations/m180312_095716_init.php#L197-L215 |
kattsoftware/phassets | src/Phassets/FilesCollector.php | FilesCollector.parse | public function parse($dirPath, array $extensions, $deep = false, array $exclusions = array())
{
$files = [];
try {
$iterator = new \DirectoryIterator($dirPath);
foreach ($iterator as $entry) {
if ($deep
&& $entry->isDir()
... | php | public function parse($dirPath, array $extensions, $deep = false, array $exclusions = array())
{
$files = [];
try {
$iterator = new \DirectoryIterator($dirPath);
foreach ($iterator as $entry) {
if ($deep
&& $entry->isDir()
... | [
"public",
"function",
"parse",
"(",
"$",
"dirPath",
",",
"array",
"$",
"extensions",
",",
"$",
"deep",
"=",
"false",
",",
"array",
"$",
"exclusions",
"=",
"array",
"(",
")",
")",
"{",
"$",
"files",
"=",
"[",
"]",
";",
"try",
"{",
"$",
"iterator",
... | Parses a folder and returns the full paths of all files from there
having the extensions in $extensions array. Setting $deep to
true will make this collector to look in all sub-folders as well.
@param string $dirPath Full path of a folder to be opened by a DirectoryIterator
@param array $extensions List of extensions ... | [
"Parses",
"a",
"folder",
"and",
"returns",
"the",
"full",
"paths",
"of",
"all",
"files",
"from",
"there",
"having",
"the",
"extensions",
"in",
"$extensions",
"array",
".",
"Setting",
"$deep",
"to",
"true",
"will",
"make",
"this",
"collector",
"to",
"look",
... | train | https://github.com/kattsoftware/phassets/blob/cc982cf1941eb5776287d64f027218bd4835ed2b/src/Phassets/FilesCollector.php#L27-L56 |
yuncms/framework | src/user/migrations/m180223_102927Create_user_extra_table.php | m180223_102927Create_user_extra_table.safeUp | public function safeUp()
{
$tableOptions = null;
if ($this->db->driverName === 'mysql') {
// http://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-unicode-ci
$tableOptions = 'CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE=Inn... | php | public function safeUp()
{
$tableOptions = null;
if ($this->db->driverName === 'mysql') {
// http://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-unicode-ci
$tableOptions = 'CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE=Inn... | [
"public",
"function",
"safeUp",
"(",
")",
"{",
"$",
"tableOptions",
"=",
"null",
";",
"if",
"(",
"$",
"this",
"->",
"db",
"->",
"driverName",
"===",
"'mysql'",
")",
"{",
"// http://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-... | {@inheritdoc} | [
"{"
] | train | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/user/migrations/m180223_102927Create_user_extra_table.php#L12-L36 |
OpenClassrooms/CacheBundle | DependencyInjection/Configuration.php | Configuration.getConfigTreeBuilder | public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('openclassrooms_cache');
$rootNode
->children()
->arrayNode('provider')
->performNoDeepMerging()
->beforeNormalization()
... | php | public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('openclassrooms_cache');
$rootNode
->children()
->arrayNode('provider')
->performNoDeepMerging()
->beforeNormalization()
... | [
"public",
"function",
"getConfigTreeBuilder",
"(",
")",
"{",
"$",
"treeBuilder",
"=",
"new",
"TreeBuilder",
"(",
")",
";",
"$",
"rootNode",
"=",
"$",
"treeBuilder",
"->",
"root",
"(",
"'openclassrooms_cache'",
")",
";",
"$",
"rootNode",
"->",
"children",
"("... | Generates the configuration tree builder.
@return \Symfony\Component\Config\Definition\Builder\TreeBuilder The tree builder | [
"Generates",
"the",
"configuration",
"tree",
"builder",
"."
] | train | https://github.com/OpenClassrooms/CacheBundle/blob/a8b9226b4370bba12190b821b45d46eb848ca34b/DependencyInjection/Configuration.php#L18-L43 |
webforge-labs/psc-cms | lib/Psc/CMS/Controller/PageController.php | PageController.processEntityFormRequest | protected function processEntityFormRequest(Entity $entity, FormData $requestData, $revision) {
$this->addOptionalProperty('contentStreams');
// erst formular bearbeiten
parent::processEntityFormRequest($entity, $requestData, $revision);
// wenn es neu ist, wollen wir die content streams erste... | php | protected function processEntityFormRequest(Entity $entity, FormData $requestData, $revision) {
$this->addOptionalProperty('contentStreams');
// erst formular bearbeiten
parent::processEntityFormRequest($entity, $requestData, $revision);
// wenn es neu ist, wollen wir die content streams erste... | [
"protected",
"function",
"processEntityFormRequest",
"(",
"Entity",
"$",
"entity",
",",
"FormData",
"$",
"requestData",
",",
"$",
"revision",
")",
"{",
"$",
"this",
"->",
"addOptionalProperty",
"(",
"'contentStreams'",
")",
";",
"// erst formular bearbeiten",
"paren... | Beim ersten Speichern eines neuen Entities fügen wir die Content-Streams (die wir vorhe rnicht anzeigen) hinzu | [
"Beim",
"ersten",
"Speichern",
"eines",
"neuen",
"Entities",
"fügen",
"wir",
"die",
"Content",
"-",
"Streams",
"(",
"die",
"wir",
"vorhe",
"rnicht",
"anzeigen",
")",
"hinzu"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/CMS/Controller/PageController.php#L94-L104 |
ClanCats/Core | src/classes/CCConsoleController.php | CCConsoleController.parse | public static function parse( $cmd )
{
// if we dont have an command
if ( empty( $cmd ) )
{
return false;
}
$params = array();
// are we in a string
$in_string = false;
$len = strlen( $cmd );
$crr_prm = "";
$command_str = $cmd;
$cmd = array();
// loop trough
for( $i=0;$len>$i;$... | php | public static function parse( $cmd )
{
// if we dont have an command
if ( empty( $cmd ) )
{
return false;
}
$params = array();
// are we in a string
$in_string = false;
$len = strlen( $cmd );
$crr_prm = "";
$command_str = $cmd;
$cmd = array();
// loop trough
for( $i=0;$len>$i;$... | [
"public",
"static",
"function",
"parse",
"(",
"$",
"cmd",
")",
"{",
"// if we dont have an command",
"if",
"(",
"empty",
"(",
"$",
"cmd",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"params",
"=",
"array",
"(",
")",
";",
"// are we in a string",
"$"... | Parse an command and execute console style
@param string $cmd | [
"Parse",
"an",
"command",
"and",
"execute",
"console",
"style"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCConsoleController.php#L21-L112 |
ClanCats/Core | src/classes/CCConsoleController.php | CCConsoleController.run | public static function run( $controller, $action = null, $params = array() )
{
// always enable the file infos
// this allows CCFile to print an info when a file gets created or deleted.
CCFile::enable_infos();
// execute by default the help action
if ( empty( $action ) )
{
$action = 'default';
}
... | php | public static function run( $controller, $action = null, $params = array() )
{
// always enable the file infos
// this allows CCFile to print an info when a file gets created or deleted.
CCFile::enable_infos();
// execute by default the help action
if ( empty( $action ) )
{
$action = 'default';
}
... | [
"public",
"static",
"function",
"run",
"(",
"$",
"controller",
",",
"$",
"action",
"=",
"null",
",",
"$",
"params",
"=",
"array",
"(",
")",
")",
"{",
"// always enable the file infos",
"// this allows CCFile to print an info when a file gets created or deleted.",
"CCFil... | Run a console script
@param string $controller
@param string $action
@param array $params | [
"Run",
"a",
"console",
"script"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCConsoleController.php#L121-L175 |
ClanCats/Core | src/classes/CCConsoleController.php | CCConsoleController._execute | public function _execute( $action, $params = array() )
{
if ( method_exists( $this, 'action_'.$action ) )
{
call_user_func( array( $this, 'action_'.$action ), $params );
}
else
{
CCCli::line( "There is no action {$action}.", 'red' );
}
} | php | public function _execute( $action, $params = array() )
{
if ( method_exists( $this, 'action_'.$action ) )
{
call_user_func( array( $this, 'action_'.$action ), $params );
}
else
{
CCCli::line( "There is no action {$action}.", 'red' );
}
} | [
"public",
"function",
"_execute",
"(",
"$",
"action",
",",
"$",
"params",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"method_exists",
"(",
"$",
"this",
",",
"'action_'",
".",
"$",
"action",
")",
")",
"{",
"call_user_func",
"(",
"array",
"(",
"$",
... | execute the controller
@param string $action
@param array $params
@return void | [
"execute",
"the",
"controller"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCConsoleController.php#L202-L212 |
ClanCats/Core | src/classes/CCConsoleController.php | CCConsoleController.action_help | public function action_help( $params ) {
if ( method_exists( $this, 'help' ) )
{
CCCli::line( $this->help_formatter( $this->help() ) ); return;
}
CCCli::line( 'This console controller does not implement an help function or action.' , 'cyan' );
} | php | public function action_help( $params ) {
if ( method_exists( $this, 'help' ) )
{
CCCli::line( $this->help_formatter( $this->help() ) ); return;
}
CCCli::line( 'This console controller does not implement an help function or action.' , 'cyan' );
} | [
"public",
"function",
"action_help",
"(",
"$",
"params",
")",
"{",
"if",
"(",
"method_exists",
"(",
"$",
"this",
",",
"'help'",
")",
")",
"{",
"CCCli",
"::",
"line",
"(",
"$",
"this",
"->",
"help_formatter",
"(",
"$",
"this",
"->",
"help",
"(",
")",
... | default help action
@param array $params
@return void | [
"default",
"help",
"action"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCConsoleController.php#L230-L236 |
ClanCats/Core | src/classes/CCConsoleController.php | CCConsoleController.help_formatter | protected function help_formatter( $help = null )
{
if ( is_null( $help ) )
{
CCCli::line( 'Invalid data passed to help formatter.' , 'red' ); return;
}
$output = array();
// print the name
if ( isset( $help['name'] ) )
{
$output[] = '+-'.str_repeat( '-', strlen( $help['name'] ) ).'-+';
... | php | protected function help_formatter( $help = null )
{
if ( is_null( $help ) )
{
CCCli::line( 'Invalid data passed to help formatter.' , 'red' ); return;
}
$output = array();
// print the name
if ( isset( $help['name'] ) )
{
$output[] = '+-'.str_repeat( '-', strlen( $help['name'] ) ).'-+';
... | [
"protected",
"function",
"help_formatter",
"(",
"$",
"help",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"help",
")",
")",
"{",
"CCCli",
"::",
"line",
"(",
"'Invalid data passed to help formatter.'",
",",
"'red'",
")",
";",
"return",
";",
"}",
... | default help formatter
@param array $params
@return void | [
"default",
"help",
"formatter"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCConsoleController.php#L244-L329 |
steeffeen/FancyManiaLinks | FML/ManiaCode/InstallScript.php | InstallScript.create | public static function create($name = null, $file = null, $url = null)
{
return new static($name, $file, $url);
} | php | public static function create($name = null, $file = null, $url = null)
{
return new static($name, $file, $url);
} | [
"public",
"static",
"function",
"create",
"(",
"$",
"name",
"=",
"null",
",",
"$",
"file",
"=",
"null",
",",
"$",
"url",
"=",
"null",
")",
"{",
"return",
"new",
"static",
"(",
"$",
"name",
",",
"$",
"file",
",",
"$",
"url",
")",
";",
"}"
] | Create a new InstallScript Element
@api
@param string $name (optional) Script name
@param string $file (optional) Script file
@param string $url (optional) Script url
@return static | [
"Create",
"a",
"new",
"InstallScript",
"Element"
] | train | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/ManiaCode/InstallScript.php#L39-L42 |
CakeCMS/Core | src/View/Helper/Traits/MaterializeCssTrait.php | MaterializeCssTrait._dataTooltip | protected function _dataTooltip(array $options, $tooltip)
{
if (Arr::key('title', $options)) {
$options['data-tooltip'] = $options['title'];
}
if (is_string($tooltip)) {
$options['data-tooltip'] = $tooltip;
}
return $options;
} | php | protected function _dataTooltip(array $options, $tooltip)
{
if (Arr::key('title', $options)) {
$options['data-tooltip'] = $options['title'];
}
if (is_string($tooltip)) {
$options['data-tooltip'] = $tooltip;
}
return $options;
} | [
"protected",
"function",
"_dataTooltip",
"(",
"array",
"$",
"options",
",",
"$",
"tooltip",
")",
"{",
"if",
"(",
"Arr",
"::",
"key",
"(",
"'title'",
",",
"$",
"options",
")",
")",
"{",
"$",
"options",
"[",
"'data-tooltip'",
"]",
"=",
"$",
"options",
... | Setup tooltip data-tooltip attr.
@param array $options
@param string $tooltip
@return array | [
"Setup",
"tooltip",
"data",
"-",
"tooltip",
"attr",
"."
] | train | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/Traits/MaterializeCssTrait.php#L38-L49 |
CakeCMS/Core | src/View/Helper/Traits/MaterializeCssTrait.php | MaterializeCssTrait._prepareBtn | protected function _prepareBtn(Helper $helper, array $options, $button)
{
$options = $helper->addClass($options, 'waves-effect waves-light btn');
if (!empty($button)) {
$options = $helper->addClass($options, Str::trim((string) $button));
}
return $options;
} | php | protected function _prepareBtn(Helper $helper, array $options, $button)
{
$options = $helper->addClass($options, 'waves-effect waves-light btn');
if (!empty($button)) {
$options = $helper->addClass($options, Str::trim((string) $button));
}
return $options;
} | [
"protected",
"function",
"_prepareBtn",
"(",
"Helper",
"$",
"helper",
",",
"array",
"$",
"options",
",",
"$",
"button",
")",
"{",
"$",
"options",
"=",
"$",
"helper",
"->",
"addClass",
"(",
"$",
"options",
",",
"'waves-effect waves-light btn'",
")",
";",
"i... | Prepare form buttons.
@param Helper $helper
@param array $options
@param string $button
@return array | [
"Prepare",
"form",
"buttons",
"."
] | train | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/Traits/MaterializeCssTrait.php#L59-L67 |
CakeCMS/Core | src/View/Helper/Traits/MaterializeCssTrait.php | MaterializeCssTrait._prepareTooltip | protected function _prepareTooltip(Helper $helper, array $options, $tooltip)
{
$_options = [
'data-position' => 'top'
];
if (Arr::key('tooltipPos', $options)) {
$_options['data-position'] = (string) $options['tooltipPos'];
unset($options['tooltipPos']);
... | php | protected function _prepareTooltip(Helper $helper, array $options, $tooltip)
{
$_options = [
'data-position' => 'top'
];
if (Arr::key('tooltipPos', $options)) {
$_options['data-position'] = (string) $options['tooltipPos'];
unset($options['tooltipPos']);
... | [
"protected",
"function",
"_prepareTooltip",
"(",
"Helper",
"$",
"helper",
",",
"array",
"$",
"options",
",",
"$",
"tooltip",
")",
"{",
"$",
"_options",
"=",
"[",
"'data-position'",
"=>",
"'top'",
"]",
";",
"if",
"(",
"Arr",
"::",
"key",
"(",
"'tooltipPos... | Prepare tooltip attrs.
@param Helper $helper
@param array $options
@param string $tooltip
@return array | [
"Prepare",
"tooltip",
"attrs",
"."
] | train | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/Traits/MaterializeCssTrait.php#L77-L93 |
CakeCMS/Core | src/View/Helper/Traits/MaterializeCssTrait.php | MaterializeCssTrait._tooltipTitle | protected function _tooltipTitle(array $options, $tooltip)
{
if ($tooltip === true && !Arr::key('title', $options)) {
$options['title'] = strip_tags($options['label']);
}
if (is_string($tooltip)) {
$options['title'] = $tooltip;
}
return $options;
... | php | protected function _tooltipTitle(array $options, $tooltip)
{
if ($tooltip === true && !Arr::key('title', $options)) {
$options['title'] = strip_tags($options['label']);
}
if (is_string($tooltip)) {
$options['title'] = $tooltip;
}
return $options;
... | [
"protected",
"function",
"_tooltipTitle",
"(",
"array",
"$",
"options",
",",
"$",
"tooltip",
")",
"{",
"if",
"(",
"$",
"tooltip",
"===",
"true",
"&&",
"!",
"Arr",
"::",
"key",
"(",
"'title'",
",",
"$",
"options",
")",
")",
"{",
"$",
"options",
"[",
... | Setup tooltip title.
@param array $options
@param string $tooltip
@return array | [
"Setup",
"tooltip",
"title",
"."
] | train | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/Traits/MaterializeCssTrait.php#L102-L113 |
aedart/laravel-helpers | src/Traits/Container/ContainerTrait.php | ContainerTrait.getContainer | public function getContainer(): ?Container
{
if (!$this->hasContainer()) {
$this->setContainer($this->getDefaultContainer());
}
return $this->container;
} | php | public function getContainer(): ?Container
{
if (!$this->hasContainer()) {
$this->setContainer($this->getDefaultContainer());
}
return $this->container;
} | [
"public",
"function",
"getContainer",
"(",
")",
":",
"?",
"Container",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasContainer",
"(",
")",
")",
"{",
"$",
"this",
"->",
"setContainer",
"(",
"$",
"this",
"->",
"getDefaultContainer",
"(",
")",
")",
";",
"... | Get container
If no container has been set, this method will
set and return a default container, if any such
value is available
@see getDefaultContainer()
@return Container|null container or null if none container has been set | [
"Get",
"container"
] | train | https://github.com/aedart/laravel-helpers/blob/8b81a2d6658f3f8cb62b6be2c34773aaa2df219a/src/Traits/Container/ContainerTrait.php#L53-L59 |
ClanCats/Core | src/console/phpunit.php | phpunit.action_build | public function action_build( $params )
{
$test_directories = array();
// check if there is an application tests direcotry
if ( is_dir( APPPATH.CCDIR_TEST ) )
{
$this->line( 'found tests in your application.' );
$test_directories['App'] = APPPATH.CCDIR_TEST;
}
// add the core tests
if ( $params[... | php | public function action_build( $params )
{
$test_directories = array();
// check if there is an application tests direcotry
if ( is_dir( APPPATH.CCDIR_TEST ) )
{
$this->line( 'found tests in your application.' );
$test_directories['App'] = APPPATH.CCDIR_TEST;
}
// add the core tests
if ( $params[... | [
"public",
"function",
"action_build",
"(",
"$",
"params",
")",
"{",
"$",
"test_directories",
"=",
"array",
"(",
")",
";",
"// check if there is an application tests direcotry",
"if",
"(",
"is_dir",
"(",
"APPPATH",
".",
"CCDIR_TEST",
")",
")",
"{",
"$",
"this",
... | Builds the phpunit.xml file
@param array $params | [
"Builds",
"the",
"phpunit",
".",
"xml",
"file"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/console/phpunit.php#L33-L96 |
webforge-labs/psc-cms | lib/Psc/DataInput.php | DataInput.getDataWithKeys | public function getDataWithKeys(Array $keys, $do = self::RETURN_NULL) {
$data = $this->data;
foreach ($keys as $key) {
if (is_array($key)) {
throw new InvalidArgumentException('$keys kann nur ein Array von Strings sein. '.Code::varInfo($keys));
}
if (!is_array($data) || !arra... | php | public function getDataWithKeys(Array $keys, $do = self::RETURN_NULL) {
$data = $this->data;
foreach ($keys as $key) {
if (is_array($key)) {
throw new InvalidArgumentException('$keys kann nur ein Array von Strings sein. '.Code::varInfo($keys));
}
if (!is_array($data) || !arra... | [
"public",
"function",
"getDataWithKeys",
"(",
"Array",
"$",
"keys",
",",
"$",
"do",
"=",
"self",
"::",
"RETURN_NULL",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"data",
";",
"foreach",
"(",
"$",
"keys",
"as",
"$",
"key",
")",
"{",
"if",
"(",
... | Gibt einen Pfad zu einem Wert aus dem Array zurück
Ableitenden Klassen können dann sowas machen:
public function bla() {
$keys = func_get_args();
return $this->getDataWithKeys($keys, self::THROW_EXCEPTION);
}
oder so
kann keine Defaults sondern nur return NULL oder eine Exception schmeissen | [
"Gibt",
"einen",
"Pfad",
"zu",
"einem",
"Wert",
"aus",
"dem",
"Array",
"zurück"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/DataInput.php#L64-L90 |
webforge-labs/psc-cms | lib/Psc/DataInput.php | DataInput.setDataWithKeys | public function setDataWithKeys(Array $keys, $value) {
$data =& $this->data;
if ($keys === array()) {
if (!is_array($value)) {
throw new DataInputException('Wenn $keys leer ist, darf value nur ein array sein!');
}
return $data = $value;
}
$lastKey = array_pop($... | php | public function setDataWithKeys(Array $keys, $value) {
$data =& $this->data;
if ($keys === array()) {
if (!is_array($value)) {
throw new DataInputException('Wenn $keys leer ist, darf value nur ein array sein!');
}
return $data = $value;
}
$lastKey = array_pop($... | [
"public",
"function",
"setDataWithKeys",
"(",
"Array",
"$",
"keys",
",",
"$",
"value",
")",
"{",
"$",
"data",
"=",
"&",
"$",
"this",
"->",
"data",
";",
"if",
"(",
"$",
"keys",
"===",
"array",
"(",
")",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
... | Setzt einen Wert mit einem Pfad
Ableitenden Klassen können dann sowas machen:
public function bla() {
$keys = func_get_args();
$value = array_pop($keys);
return $this->setDataWithKeys($keys, $value, self::THROW_EXCEPTION);
}
oder so
ist $keys ein leerer array werden alle Daten des Objektes mit $value ersetzt.
ist $v... | [
"Setzt",
"einen",
"Wert",
"mit",
"einem",
"Pfad"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/DataInput.php#L109-L130 |
webforge-labs/psc-cms | lib/Psc/DataInput.php | DataInput.get | public function get($keys, $do = self::RETURN_NULL, $default = NULL) {
if (is_string($keys)) $keys = explode('.',$keys);
try {
$data = $this->getDataWithKeys($keys, self::THROW_EXCEPTION);
} catch (DataInputException $e) {
/* Do */
if ($do === self::THROW_EXCEPTION)
thr... | php | public function get($keys, $do = self::RETURN_NULL, $default = NULL) {
if (is_string($keys)) $keys = explode('.',$keys);
try {
$data = $this->getDataWithKeys($keys, self::THROW_EXCEPTION);
} catch (DataInputException $e) {
/* Do */
if ($do === self::THROW_EXCEPTION)
thr... | [
"public",
"function",
"get",
"(",
"$",
"keys",
",",
"$",
"do",
"=",
"self",
"::",
"RETURN_NULL",
",",
"$",
"default",
"=",
"NULL",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"keys",
")",
")",
"$",
"keys",
"=",
"explode",
"(",
"'.'",
",",
"$",
... | Gibt einen Wert aus den Daten zurück
Der dritte Parameter ist anfangs etwas verwirred, er ist aber dafür da ein fine-grained control über diese Klase zu bekommen
Der Standardfall den man aus einem Formular machen möchte ist z. B.:
$ids = $formDataPOST->get(array('data','ids'), array());
was hier passiert ist, dass w... | [
"Gibt",
"einen",
"Wert",
"aus",
"den",
"Daten",
"zurück"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/DataInput.php#L187-L216 |
webforge-labs/psc-cms | lib/Psc/DataInput.php | DataInput.set | public function set($keys, $value) {
if (is_string($keys)) $keys = explode('.',$keys);
if (is_integer($keys)) $keys = array($keys);
return $this->setDataWithKeys($keys, $value);
} | php | public function set($keys, $value) {
if (is_string($keys)) $keys = explode('.',$keys);
if (is_integer($keys)) $keys = array($keys);
return $this->setDataWithKeys($keys, $value);
} | [
"public",
"function",
"set",
"(",
"$",
"keys",
",",
"$",
"value",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"keys",
")",
")",
"$",
"keys",
"=",
"explode",
"(",
"'.'",
",",
"$",
"keys",
")",
";",
"if",
"(",
"is_integer",
"(",
"$",
"keys",
")",... | Setzt einen Wert in den Daten
@param string|array $keys
@param mixed $value | [
"Setzt",
"einen",
"Wert",
"in",
"den",
"Daten"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/DataInput.php#L224-L229 |
webforge-labs/psc-cms | lib/Psc/DataInput.php | DataInput.remove | public function remove(array $keys) {
$data =& $this->data;
if ($keys === array() || $keys == NULL) {
return $this;
}
$lastKey = array_pop($keys);
foreach ($keys as $key) {
if (!array_key_exists($key,$data)) {
return $this;
}
$data =& $data[$key];
}
... | php | public function remove(array $keys) {
$data =& $this->data;
if ($keys === array() || $keys == NULL) {
return $this;
}
$lastKey = array_pop($keys);
foreach ($keys as $key) {
if (!array_key_exists($key,$data)) {
return $this;
}
$data =& $data[$key];
}
... | [
"public",
"function",
"remove",
"(",
"array",
"$",
"keys",
")",
"{",
"$",
"data",
"=",
"&",
"$",
"this",
"->",
"data",
";",
"if",
"(",
"$",
"keys",
"===",
"array",
"(",
")",
"||",
"$",
"keys",
"==",
"NULL",
")",
"{",
"return",
"$",
"this",
";",... | Entfernt Schlüssel aus den Daten
alle Schlüssel darunter werden ebenfalls entfernt. Wird der Schlüssel nicht gefunden, passiert nichts | [
"Entfernt",
"Schlüssel",
"aus",
"den",
"Daten"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/DataInput.php#L237-L255 |
yuncms/framework | src/sms/Sms.php | Sms.send | public function send($to, $message, array $gateways = []): array
{
return $this->getMessenger()->send($to, $message, $gateways);
} | php | public function send($to, $message, array $gateways = []): array
{
return $this->getMessenger()->send($to, $message, $gateways);
} | [
"public",
"function",
"send",
"(",
"$",
"to",
",",
"$",
"message",
",",
"array",
"$",
"gateways",
"=",
"[",
"]",
")",
":",
"array",
"{",
"return",
"$",
"this",
"->",
"getMessenger",
"(",
")",
"->",
"send",
"(",
"$",
"to",
",",
"$",
"message",
","... | Send a message.
@param string|array $to
@param array|string|MessageInterface $message
@param array $gateways
@return array
@throws InvalidConfigException
@throws exceptions\NoGatewayAvailableException | [
"Send",
"a",
"message",
"."
] | train | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/sms/Sms.php#L75-L78 |
yuncms/framework | src/sms/Sms.php | Sms.strategy | public function strategy($strategy = null)
{
if (is_null($strategy)) {
$strategy = $this->defaultStrategy ?: OrderStrategy::class;
}
if (!class_exists($strategy)) {
$strategy = __NAMESPACE__ . '\strategies\\' . ucfirst($strategy);
}
if (!class_exists... | php | public function strategy($strategy = null)
{
if (is_null($strategy)) {
$strategy = $this->defaultStrategy ?: OrderStrategy::class;
}
if (!class_exists($strategy)) {
$strategy = __NAMESPACE__ . '\strategies\\' . ucfirst($strategy);
}
if (!class_exists... | [
"public",
"function",
"strategy",
"(",
"$",
"strategy",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"strategy",
")",
")",
"{",
"$",
"strategy",
"=",
"$",
"this",
"->",
"defaultStrategy",
"?",
":",
"OrderStrategy",
"::",
"class",
";",
"}",
... | Get a strategy instance.
@param string|null $strategy
@return StrategyInterface
@throws InvalidArgumentException | [
"Get",
"a",
"strategy",
"instance",
"."
] | train | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/sms/Sms.php#L95-L114 |
yuncms/framework | src/sms/Sms.php | Sms.has | public function has($id, $checkInstance = false)
{
return $checkInstance ? isset($this->_gateways[$id]) : isset($this->_definitions[$id]);
} | php | public function has($id, $checkInstance = false)
{
return $checkInstance ? isset($this->_gateways[$id]) : isset($this->_definitions[$id]);
} | [
"public",
"function",
"has",
"(",
"$",
"id",
",",
"$",
"checkInstance",
"=",
"false",
")",
"{",
"return",
"$",
"checkInstance",
"?",
"isset",
"(",
"$",
"this",
"->",
"_gateways",
"[",
"$",
"id",
"]",
")",
":",
"isset",
"(",
"$",
"this",
"->",
"_def... | Returns a value indicating whether the locator has the specified gateway definition or has instantiated the gateway.
This method may return different results depending on the value of `$checkInstance`.
- If `$checkInstance` is false (default), the method will return a value indicating whether the locator has the speci... | [
"Returns",
"a",
"value",
"indicating",
"whether",
"the",
"locator",
"has",
"the",
"specified",
"gateway",
"definition",
"or",
"has",
"instantiated",
"the",
"gateway",
".",
"This",
"method",
"may",
"return",
"different",
"results",
"depending",
"on",
"the",
"valu... | train | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/sms/Sms.php#L162-L165 |
yuncms/framework | src/sms/Sms.php | Sms.get | public function get($id, $throwException = true)
{
if (isset($this->_gateways[$id])) {
return $this->_gateways[$id];
}
if (isset($this->_definitions[$id])) {
$definition = $this->_definitions[$id];
if (is_object($definition) && !$definition instanceof Clo... | php | public function get($id, $throwException = true)
{
if (isset($this->_gateways[$id])) {
return $this->_gateways[$id];
}
if (isset($this->_definitions[$id])) {
$definition = $this->_definitions[$id];
if (is_object($definition) && !$definition instanceof Clo... | [
"public",
"function",
"get",
"(",
"$",
"id",
",",
"$",
"throwException",
"=",
"true",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_gateways",
"[",
"$",
"id",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"_gateways",
"[",
"$",
"id",... | Returns the gateway instance with the specified ID.
@param string $id gateway ID (e.g. `db`).
@param bool $throwException whether to throw an exception if `$id` is not registered with the locator before.
@return object|null the gateway of the specified ID. If `$throwException` is false and `$id`
is not registered befo... | [
"Returns",
"the",
"gateway",
"instance",
"with",
"the",
"specified",
"ID",
"."
] | train | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/sms/Sms.php#L178-L196 |
yuncms/framework | src/sms/Sms.php | Sms.set | public function set($id, $definition)
{
unset($this->_gateways[$id]);
if ($definition === null) {
unset($this->_definitions[$id]);
return;
}
if (is_object($definition) || is_callable($definition, true)) {
// an object, a class name, or a PHP call... | php | public function set($id, $definition)
{
unset($this->_gateways[$id]);
if ($definition === null) {
unset($this->_definitions[$id]);
return;
}
if (is_object($definition) || is_callable($definition, true)) {
// an object, a class name, or a PHP call... | [
"public",
"function",
"set",
"(",
"$",
"id",
",",
"$",
"definition",
")",
"{",
"unset",
"(",
"$",
"this",
"->",
"_gateways",
"[",
"$",
"id",
"]",
")",
";",
"if",
"(",
"$",
"definition",
"===",
"null",
")",
"{",
"unset",
"(",
"$",
"this",
"->",
... | Registers a gateway definition with this locator.
For example,
```php
// a class name
$locator->set('cache', 'yii\caching\FileCache');
// a configuration array
$locator->set('db', [
'class' => 'yii\db\Connection',
'dsn' => 'mysql:host=127.0.0.1;dbname=demo',
'username' => 'root',
'password' => '',
'charset' => 'utf8... | [
"Registers",
"a",
"gateway",
"definition",
"with",
"this",
"locator",
"."
] | train | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/sms/Sms.php#L241-L263 |
yuncms/framework | src/sms/Sms.php | Sms.setGateways | public function setGateways($gateways)
{
foreach ($gateways as $id => $gateway) {
$this->set($id, $gateway);
}
} | php | public function setGateways($gateways)
{
foreach ($gateways as $id => $gateway) {
$this->set($id, $gateway);
}
} | [
"public",
"function",
"setGateways",
"(",
"$",
"gateways",
")",
"{",
"foreach",
"(",
"$",
"gateways",
"as",
"$",
"id",
"=>",
"$",
"gateway",
")",
"{",
"$",
"this",
"->",
"set",
"(",
"$",
"id",
",",
"$",
"gateway",
")",
";",
"}",
"}"
] | Registers a set of gateway definitions in this locator.
This is the bulk version of [[set()]]. The parameter should be an array
whose keys are gateway IDs and values the corresponding gateway definitions.
For more details on how to specify gateway IDs and definitions, please refer to [[set()]].
If a gateway definiti... | [
"Registers",
"a",
"set",
"of",
"gateway",
"definitions",
"in",
"this",
"locator",
"."
] | train | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/sms/Sms.php#L308-L313 |
nexusnetsoftgmbh/nexuscli | src/Nexus/Dumper/Business/DumperBusinessFactory.php | DumperBusinessFactory.createDumper | public function createDumper(DumperConfigDataProvider $configDataProvider): DumperInterface
{
$configDataProvider->setSshHost($this->getConfig()->getSshHost());
$configDataProvider->setSshUser($this->getConfig()->getSshUser());
$configDataProvider->setProject($this->getConfig()->getProject()... | php | public function createDumper(DumperConfigDataProvider $configDataProvider): DumperInterface
{
$configDataProvider->setSshHost($this->getConfig()->getSshHost());
$configDataProvider->setSshUser($this->getConfig()->getSshUser());
$configDataProvider->setProject($this->getConfig()->getProject()... | [
"public",
"function",
"createDumper",
"(",
"DumperConfigDataProvider",
"$",
"configDataProvider",
")",
":",
"DumperInterface",
"{",
"$",
"configDataProvider",
"->",
"setSshHost",
"(",
"$",
"this",
"->",
"getConfig",
"(",
")",
"->",
"getSshHost",
"(",
")",
")",
"... | @param \DataProvider\DumperConfigDataProvider $configDataProvider
@return \Nexus\Dumper\Business\Model\Dumper | [
"@param",
"\\",
"DataProvider",
"\\",
"DumperConfigDataProvider",
"$configDataProvider"
] | train | https://github.com/nexusnetsoftgmbh/nexuscli/blob/8416b43d31ad56ea379ae2b0bf85d456e78ba67a/src/Nexus/Dumper/Business/DumperBusinessFactory.php#L24-L36 |
Ocramius/OcraDiCompiler | src/OcraDiCompiler/Dumper.php | Dumper.getClasses | public function getClasses($name)
{
$classes = array();
$instanceDefinitions = $this->getInjectedDefinitions($name);
foreach ($instanceDefinitions as $instanceDefinition) {
if ($instanceDefinition->getClass()) {
$classes[$instanceDefinition->getClass()] = true;
... | php | public function getClasses($name)
{
$classes = array();
$instanceDefinitions = $this->getInjectedDefinitions($name);
foreach ($instanceDefinitions as $instanceDefinition) {
if ($instanceDefinition->getClass()) {
$classes[$instanceDefinition->getClass()] = true;
... | [
"public",
"function",
"getClasses",
"(",
"$",
"name",
")",
"{",
"$",
"classes",
"=",
"array",
"(",
")",
";",
"$",
"instanceDefinitions",
"=",
"$",
"this",
"->",
"getInjectedDefinitions",
"(",
"$",
"name",
")",
";",
"foreach",
"(",
"$",
"instanceDefinitions... | Retrieves all classes that are involved in generating an instance for $name and its dependencies
@param array|string $name
@return string[] | [
"Retrieves",
"all",
"classes",
"that",
"are",
"involved",
"in",
"generating",
"an",
"instance",
"for",
"$name",
"and",
"its",
"dependencies"
] | train | https://github.com/Ocramius/OcraDiCompiler/blob/667f4b24771f27fb9c8d6c38ffaf72d9cd55ca4a/src/OcraDiCompiler/Dumper.php#L106-L122 |
Ocramius/OcraDiCompiler | src/OcraDiCompiler/Dumper.php | Dumper.getInjectedDefinitions | public function getInjectedDefinitions($name)
{
$names = (array) $name;
$visited = array();
foreach ($names as $name) {
$this->doGetInjectedDefinitions($name, $visited);
}
return $visited;
} | php | public function getInjectedDefinitions($name)
{
$names = (array) $name;
$visited = array();
foreach ($names as $name) {
$this->doGetInjectedDefinitions($name, $visited);
}
return $visited;
} | [
"public",
"function",
"getInjectedDefinitions",
"(",
"$",
"name",
")",
"{",
"$",
"names",
"=",
"(",
"array",
")",
"$",
"name",
";",
"$",
"visited",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"names",
"as",
"$",
"name",
")",
"{",
"$",
"this",... | Retrieves all GeneratorInstances that represent instantiation of an instance for $name and its dependencies
@param string|array $name name or names of the instances to get
@return GeneratorInstance[] all definitions discovered recursively | [
"Retrieves",
"all",
"GeneratorInstances",
"that",
"represent",
"instantiation",
"of",
"an",
"instance",
"for",
"$name",
"and",
"its",
"dependencies"
] | train | https://github.com/Ocramius/OcraDiCompiler/blob/667f4b24771f27fb9c8d6c38ffaf72d9cd55ca4a/src/OcraDiCompiler/Dumper.php#L131-L141 |
Ocramius/OcraDiCompiler | src/OcraDiCompiler/Dumper.php | Dumper.doGetInjectedDefinitions | protected function doGetInjectedDefinitions($name, array &$visited)
{
if (isset($visited[$name])) {
return;
}
try {
$visited[$name] = $this->proxy->get($name);
} catch (RuntimeException $e) {
// usually abstract class or interface that cannot be r... | php | protected function doGetInjectedDefinitions($name, array &$visited)
{
if (isset($visited[$name])) {
return;
}
try {
$visited[$name] = $this->proxy->get($name);
} catch (RuntimeException $e) {
// usually abstract class or interface that cannot be r... | [
"protected",
"function",
"doGetInjectedDefinitions",
"(",
"$",
"name",
",",
"array",
"&",
"$",
"visited",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"visited",
"[",
"$",
"name",
"]",
")",
")",
"{",
"return",
";",
"}",
"try",
"{",
"$",
"visited",
"[",
... | Recursively looks for discovered dependencies
@param string $name of the instances to get
@param array $visited the array where discovered instance definitions will be stored | [
"Recursively",
"looks",
"for",
"discovered",
"dependencies"
] | train | https://github.com/Ocramius/OcraDiCompiler/blob/667f4b24771f27fb9c8d6c38ffaf72d9cd55ca4a/src/OcraDiCompiler/Dumper.php#L149-L183 |
silvercommerce/catalogue-frontend | src/control/CatalogueController.php | CatalogueController.getFilter | public function getFilter()
{
$filter = [];
$tag = $this->getRequest()->getVar("t");
if ($tag) {
$filter["Tags.URLSegment"] = $tag;
}
$this->extend("updateFilter", $filter);
return $filter;
} | php | public function getFilter()
{
$filter = [];
$tag = $this->getRequest()->getVar("t");
if ($tag) {
$filter["Tags.URLSegment"] = $tag;
}
$this->extend("updateFilter", $filter);
return $filter;
} | [
"public",
"function",
"getFilter",
"(",
")",
"{",
"$",
"filter",
"=",
"[",
"]",
";",
"$",
"tag",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
"->",
"getVar",
"(",
"\"t\"",
")",
";",
"if",
"(",
"$",
"tag",
")",
"{",
"$",
"filter",
"[",
"\"Tag... | Find a filter from the URL that we can apply to the products list
@return array | [
"Find",
"a",
"filter",
"from",
"the",
"URL",
"that",
"we",
"can",
"apply",
"to",
"the",
"products",
"list"
] | train | https://github.com/silvercommerce/catalogue-frontend/blob/671f1e32bf6bc6eb193c6608ae904cd055540cc4/src/control/CatalogueController.php#L31-L43 |
silvercommerce/catalogue-frontend | src/control/CatalogueController.php | CatalogueController.PaginatedProducts | public function PaginatedProducts($limit = 10)
{
$products = $this->SortedProducts();
$filter = $this->getFilter();
if (count($filter)) {
$products = $products->filter($filter);
}
return PaginatedList::create(
$products,
$this->getRequest... | php | public function PaginatedProducts($limit = 10)
{
$products = $this->SortedProducts();
$filter = $this->getFilter();
if (count($filter)) {
$products = $products->filter($filter);
}
return PaginatedList::create(
$products,
$this->getRequest... | [
"public",
"function",
"PaginatedProducts",
"(",
"$",
"limit",
"=",
"10",
")",
"{",
"$",
"products",
"=",
"$",
"this",
"->",
"SortedProducts",
"(",
")",
";",
"$",
"filter",
"=",
"$",
"this",
"->",
"getFilter",
"(",
")",
";",
"if",
"(",
"count",
"(",
... | Get a paginated list of products contained in this category
@return PaginatedList | [
"Get",
"a",
"paginated",
"list",
"of",
"products",
"contained",
"in",
"this",
"category"
] | train | https://github.com/silvercommerce/catalogue-frontend/blob/671f1e32bf6bc6eb193c6608ae904cd055540cc4/src/control/CatalogueController.php#L50-L63 |
silvercommerce/catalogue-frontend | src/control/CatalogueController.php | CatalogueController.PaginatedAllProducts | public function PaginatedAllProducts($limit = 10)
{
$products = $this->AllProducts();
$filter = $this->getFilter();
if (count($filter)) {
$products = $products->filter($filter);
}
return PaginatedList::create(
$products,
$this->getRequest... | php | public function PaginatedAllProducts($limit = 10)
{
$products = $this->AllProducts();
$filter = $this->getFilter();
if (count($filter)) {
$products = $products->filter($filter);
}
return PaginatedList::create(
$products,
$this->getRequest... | [
"public",
"function",
"PaginatedAllProducts",
"(",
"$",
"limit",
"=",
"10",
")",
"{",
"$",
"products",
"=",
"$",
"this",
"->",
"AllProducts",
"(",
")",
";",
"$",
"filter",
"=",
"$",
"this",
"->",
"getFilter",
"(",
")",
";",
"if",
"(",
"count",
"(",
... | Get a paginated list of all products at this level and below
@return PaginatedList | [
"Get",
"a",
"paginated",
"list",
"of",
"all",
"products",
"at",
"this",
"level",
"and",
"below"
] | train | https://github.com/silvercommerce/catalogue-frontend/blob/671f1e32bf6bc6eb193c6608ae904cd055540cc4/src/control/CatalogueController.php#L71-L84 |
silvercommerce/catalogue-frontend | src/control/CatalogueController.php | CatalogueController.handleRequest | public function handleRequest(HTTPRequest $request)
{
/** @var SiteTree $child */
$child = null;
$action = $request->param('Action');
// If nested URLs are enabled, and there is no action handler for the current request then attempt to pass
// control to a child controller.... | php | public function handleRequest(HTTPRequest $request)
{
/** @var SiteTree $child */
$child = null;
$action = $request->param('Action');
// If nested URLs are enabled, and there is no action handler for the current request then attempt to pass
// control to a child controller.... | [
"public",
"function",
"handleRequest",
"(",
"HTTPRequest",
"$",
"request",
")",
"{",
"/** @var SiteTree $child */",
"$",
"child",
"=",
"null",
";",
"$",
"action",
"=",
"$",
"request",
"->",
"param",
"(",
"'Action'",
")",
";",
"// If nested URLs are enabled, and th... | This acts the same as {@link Controller::handleRequest()}, but if an action cannot be found this will attempt to
fall over to a child controller in order to provide functionality for nested URLs.
@param HTTPRequest $request
@return HTTPResponse
@throws HTTPResponse_Exception | [
"This",
"acts",
"the",
"same",
"as",
"{",
"@link",
"Controller",
"::",
"handleRequest",
"()",
"}",
"but",
"if",
"an",
"action",
"cannot",
"be",
"found",
"this",
"will",
"attempt",
"to",
"fall",
"over",
"to",
"a",
"child",
"controller",
"in",
"order",
"to... | train | https://github.com/silvercommerce/catalogue-frontend/blob/671f1e32bf6bc6eb193c6608ae904cd055540cc4/src/control/CatalogueController.php#L145-L222 |
silvercommerce/catalogue-frontend | src/control/CatalogueController.php | CatalogueController.getViewer | public function getViewer($action)
{
// Manually set templates should be dealt with by Controller::getViewer()
if (isset($this->templates[$action]) && $this->templates[$action]
|| (isset($this->templates['index']) && $this->templates['index'])
|| $this->template
) {
... | php | public function getViewer($action)
{
// Manually set templates should be dealt with by Controller::getViewer()
if (isset($this->templates[$action]) && $this->templates[$action]
|| (isset($this->templates['index']) && $this->templates['index'])
|| $this->template
) {
... | [
"public",
"function",
"getViewer",
"(",
"$",
"action",
")",
"{",
"// Manually set templates should be dealt with by Controller::getViewer()",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"templates",
"[",
"$",
"action",
"]",
")",
"&&",
"$",
"this",
"->",
"templates... | Overwrite default SSViewer call to get a custom
template list
@param $action string
@return SSViewer | [
"Overwrite",
"default",
"SSViewer",
"call",
"to",
"get",
"a",
"custom",
"template",
"list"
] | train | https://github.com/silvercommerce/catalogue-frontend/blob/671f1e32bf6bc6eb193c6608ae904cd055540cc4/src/control/CatalogueController.php#L231-L261 |
silvercommerce/catalogue-frontend | src/control/CatalogueController.php | CatalogueController.CategoryMenu | public function CategoryMenu($level = 1)
{
if ($level == 1) {
$result = CatalogueCategory::get()->filter(array(
"ParentID" => 0
));
} else {
$parent = $this->data();
$stack = array($parent);
if ($parent) {
w... | php | public function CategoryMenu($level = 1)
{
if ($level == 1) {
$result = CatalogueCategory::get()->filter(array(
"ParentID" => 0
));
} else {
$parent = $this->data();
$stack = array($parent);
if ($parent) {
w... | [
"public",
"function",
"CategoryMenu",
"(",
"$",
"level",
"=",
"1",
")",
"{",
"if",
"(",
"$",
"level",
"==",
"1",
")",
"{",
"$",
"result",
"=",
"CatalogueCategory",
"::",
"get",
"(",
")",
"->",
"filter",
"(",
"array",
"(",
"\"ParentID\"",
"=>",
"0",
... | Returns a fixed navigation menu of the given level.
@return SS_List | [
"Returns",
"a",
"fixed",
"navigation",
"menu",
"of",
"the",
"given",
"level",
"."
] | train | https://github.com/silvercommerce/catalogue-frontend/blob/671f1e32bf6bc6eb193c6608ae904cd055540cc4/src/control/CatalogueController.php#L267-L299 |
nyeholt/silverstripe-external-content | code/forms/ExternalHtmlEditorField_Toolbar.php | ExternalHtmlEditorField_Toolbar.LinkForm | function LinkForm() {
Requirements::javascript(THIRDPARTY_DIR . "/behaviour.js");
Requirements::javascript(ExternalContentAdmin::$directory . "/javascript/external_tiny_mce_improvements.js");
$form = new Form(
$this->controller,
"{$this->name}/LinkForm",
new FieldSet(
new LiteralField('Heading', '<h... | php | function LinkForm() {
Requirements::javascript(THIRDPARTY_DIR . "/behaviour.js");
Requirements::javascript(ExternalContentAdmin::$directory . "/javascript/external_tiny_mce_improvements.js");
$form = new Form(
$this->controller,
"{$this->name}/LinkForm",
new FieldSet(
new LiteralField('Heading', '<h... | [
"function",
"LinkForm",
"(",
")",
"{",
"Requirements",
"::",
"javascript",
"(",
"THIRDPARTY_DIR",
".",
"\"/behaviour.js\"",
")",
";",
"Requirements",
"::",
"javascript",
"(",
"ExternalContentAdmin",
"::",
"$",
"directory",
".",
"\"/javascript/external_tiny_mce_improveme... | Return a {@link Form} instance allowing a user to
add links in the TinyMCE content editor.
@return Form | [
"Return",
"a",
"{",
"@link",
"Form",
"}",
"instance",
"allowing",
"a",
"user",
"to",
"add",
"links",
"in",
"the",
"TinyMCE",
"content",
"editor",
"."
] | train | https://github.com/nyeholt/silverstripe-external-content/blob/1c6da8c56ef717225ff904e1522aff94ed051601/code/forms/ExternalHtmlEditorField_Toolbar.php#L26-L66 |
nyeholt/silverstripe-external-content | code/forms/ExternalHtmlEditorField_Toolbar.php | ExternalHtmlEditorField_Toolbar.ImageForm | function ImageForm() {
Requirements::javascript(THIRDPARTY_DIR . "/behaviour.js");
Requirements::javascript(EXTERNALCONTENT . "/javascript/external_tiny_mce_improvements.js");
Requirements::css('cms/css/TinyMCEImageEnhancement.css');
Requirements::javascript('cms/javascript/TinyMCEImageEnhancement.js');
Requi... | php | function ImageForm() {
Requirements::javascript(THIRDPARTY_DIR . "/behaviour.js");
Requirements::javascript(EXTERNALCONTENT . "/javascript/external_tiny_mce_improvements.js");
Requirements::css('cms/css/TinyMCEImageEnhancement.css');
Requirements::javascript('cms/javascript/TinyMCEImageEnhancement.js');
Requi... | [
"function",
"ImageForm",
"(",
")",
"{",
"Requirements",
"::",
"javascript",
"(",
"THIRDPARTY_DIR",
".",
"\"/behaviour.js\"",
")",
";",
"Requirements",
"::",
"javascript",
"(",
"EXTERNALCONTENT",
".",
"\"/javascript/external_tiny_mce_improvements.js\"",
")",
";",
"Requir... | Return a {@link Form} instance allowing a user to
add images to the TinyMCE content editor.
@return Form | [
"Return",
"a",
"{",
"@link",
"Form",
"}",
"instance",
"allowing",
"a",
"user",
"to",
"add",
"images",
"to",
"the",
"TinyMCE",
"content",
"editor",
"."
] | train | https://github.com/nyeholt/silverstripe-external-content/blob/1c6da8c56ef717225ff904e1522aff94ed051601/code/forms/ExternalHtmlEditorField_Toolbar.php#L74-L129 |
zircote/AMQP | library/AMQP/Channel.php | Channel.doClose | protected function doClose()
{
$this->isOpen = false;
unset($this->connection->channels[$this->channelId]);
$this->channelId = $this->connection = null;
} | php | protected function doClose()
{
$this->isOpen = false;
unset($this->connection->channels[$this->channelId]);
$this->channelId = $this->connection = null;
} | [
"protected",
"function",
"doClose",
"(",
")",
"{",
"$",
"this",
"->",
"isOpen",
"=",
"false",
";",
"unset",
"(",
"$",
"this",
"->",
"connection",
"->",
"channels",
"[",
"$",
"this",
"->",
"channelId",
"]",
")",
";",
"$",
"this",
"->",
"channelId",
"=... | Tear down this object, after we've agreed to close with the server. | [
"Tear",
"down",
"this",
"object",
"after",
"we",
"ve",
"agreed",
"to",
"close",
"with",
"the",
"server",
"."
] | train | https://github.com/zircote/AMQP/blob/b96777b372f556797db4fd0ba02edb18d4bf4a1e/library/AMQP/Channel.php#L108-L113 |
zircote/AMQP | library/AMQP/Channel.php | Channel.alert | protected function alert(\AMQP\Wire\Reader $args)
{
$replyCode = $args->readShort();
$replyText = $args->readShortstr();
$details = $args->readTable();
array_push($this->alerts, array($replyCode, $replyText, $details));
} | php | protected function alert(\AMQP\Wire\Reader $args)
{
$replyCode = $args->readShort();
$replyText = $args->readShortstr();
$details = $args->readTable();
array_push($this->alerts, array($replyCode, $replyText, $details));
} | [
"protected",
"function",
"alert",
"(",
"\\",
"AMQP",
"\\",
"Wire",
"\\",
"Reader",
"$",
"args",
")",
"{",
"$",
"replyCode",
"=",
"$",
"args",
"->",
"readShort",
"(",
")",
";",
"$",
"replyText",
"=",
"$",
"args",
"->",
"readShortstr",
"(",
")",
";",
... | This method allows the server to send a non-fatal warning to
the client. This is used for methods that are normally
asynchronous and thus do not have confirmations, and for which
the server may detect errors that need to be reported. Fatal
errors are handled as channel or connection exceptions; non-
fatal errors are ... | [
"This",
"method",
"allows",
"the",
"server",
"to",
"send",
"a",
"non",
"-",
"fatal",
"warning",
"to",
"the",
"client",
".",
"This",
"is",
"used",
"for",
"methods",
"that",
"are",
"normally",
"asynchronous",
"and",
"thus",
"do",
"not",
"have",
"confirmation... | train | https://github.com/zircote/AMQP/blob/b96777b372f556797db4fd0ba02edb18d4bf4a1e/library/AMQP/Channel.php#L125-L132 |
zircote/AMQP | library/AMQP/Channel.php | Channel.close | public function close($options = array())
{
$default = array('reply_code' => 0, 'reply_text' => '', 'method_signature' => array(0,0));
$options = array_merge($default, $options);
$args = $this->frameBuilder->channelClose($options);
$this->sendMethodFrame(array(20, 40), $args);
... | php | public function close($options = array())
{
$default = array('reply_code' => 0, 'reply_text' => '', 'method_signature' => array(0,0));
$options = array_merge($default, $options);
$args = $this->frameBuilder->channelClose($options);
$this->sendMethodFrame(array(20, 40), $args);
... | [
"public",
"function",
"close",
"(",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"default",
"=",
"array",
"(",
"'reply_code'",
"=>",
"0",
",",
"'reply_text'",
"=>",
"''",
",",
"'method_signature'",
"=>",
"array",
"(",
"0",
",",
"0",
")",
")... | @param array $options
@return mixed|null
close(array(
'reply_code' => 0,
'reply_text' => '',
'method_signature' => array(0,0))
) | [
"@param",
"array",
"$options"
] | train | https://github.com/zircote/AMQP/blob/b96777b372f556797db4fd0ba02edb18d4bf4a1e/library/AMQP/Channel.php#L145-L157 |
zircote/AMQP | library/AMQP/Channel.php | Channel._close | protected function _close(\AMQP\Wire\Reader $args)
{
$replyCode = $args->readShort();
$replyText = $args->readShortstr();
$classId = $args->readShort();
$methodId = $args->readShort();
$this->sendMethodFrame(array(20, 41));
$this->doClose();
throw new Channe... | php | protected function _close(\AMQP\Wire\Reader $args)
{
$replyCode = $args->readShort();
$replyText = $args->readShortstr();
$classId = $args->readShort();
$methodId = $args->readShort();
$this->sendMethodFrame(array(20, 41));
$this->doClose();
throw new Channe... | [
"protected",
"function",
"_close",
"(",
"\\",
"AMQP",
"\\",
"Wire",
"\\",
"Reader",
"$",
"args",
")",
"{",
"$",
"replyCode",
"=",
"$",
"args",
"->",
"readShort",
"(",
")",
";",
"$",
"replyText",
"=",
"$",
"args",
"->",
"readShortstr",
"(",
")",
";",
... | @param \AMQP\Wire\Reader $args
@throws \AMQP\Exception\ChannelException | [
"@param",
"\\",
"AMQP",
"\\",
"Wire",
"\\",
"Reader",
"$args"
] | train | https://github.com/zircote/AMQP/blob/b96777b372f556797db4fd0ba02edb18d4bf4a1e/library/AMQP/Channel.php#L164-L175 |
zircote/AMQP | library/AMQP/Channel.php | Channel.flow | public function flow($active)
{
$args = $this->frameBuilder->flow($active);
$this->sendMethodFrame(array(20, 20), $args);
return $this->wait(
array(
"20,21" //Channel.flowOk
)
);
} | php | public function flow($active)
{
$args = $this->frameBuilder->flow($active);
$this->sendMethodFrame(array(20, 20), $args);
return $this->wait(
array(
"20,21" //Channel.flowOk
)
);
} | [
"public",
"function",
"flow",
"(",
"$",
"active",
")",
"{",
"$",
"args",
"=",
"$",
"this",
"->",
"frameBuilder",
"->",
"flow",
"(",
"$",
"active",
")",
";",
"$",
"this",
"->",
"sendMethodFrame",
"(",
"array",
"(",
"20",
",",
"20",
")",
",",
"$",
... | @param $active
@return mixed|null | [
"@param",
"$active"
] | train | https://github.com/zircote/AMQP/blob/b96777b372f556797db4fd0ba02edb18d4bf4a1e/library/AMQP/Channel.php#L190-L199 |
zircote/AMQP | library/AMQP/Channel.php | Channel.xOpen | protected function xOpen($outOfBand = '')
{
if ($this->isOpen) {
return null;
}
$args = $this->frameBuilder->xOpen($outOfBand);
$this->sendMethodFrame(array(20, 10), $args);
return $this->wait(
array(
"20,11" //Channel.openOk
... | php | protected function xOpen($outOfBand = '')
{
if ($this->isOpen) {
return null;
}
$args = $this->frameBuilder->xOpen($outOfBand);
$this->sendMethodFrame(array(20, 10), $args);
return $this->wait(
array(
"20,11" //Channel.openOk
... | [
"protected",
"function",
"xOpen",
"(",
"$",
"outOfBand",
"=",
"''",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isOpen",
")",
"{",
"return",
"null",
";",
"}",
"$",
"args",
"=",
"$",
"this",
"->",
"frameBuilder",
"->",
"xOpen",
"(",
"$",
"outOfBand",
"... | @param string $outOfBand
@return mixed|null | [
"@param",
"string",
"$outOfBand"
] | train | https://github.com/zircote/AMQP/blob/b96777b372f556797db4fd0ba02edb18d4bf4a1e/library/AMQP/Channel.php#L234-L247 |
zircote/AMQP | library/AMQP/Channel.php | Channel.accessRequest | public function accessRequest($realm, $options = array())
{
$default = array('exclusive' => false, 'passive' => false, 'active' => false, 'write' => false, 'read' => false);
$options = array_merge($default, $options);
$args = $this->frameBuilder->accessRequest($realm, $options);
$thi... | php | public function accessRequest($realm, $options = array())
{
$default = array('exclusive' => false, 'passive' => false, 'active' => false, 'write' => false, 'read' => false);
$options = array_merge($default, $options);
$args = $this->frameBuilder->accessRequest($realm, $options);
$thi... | [
"public",
"function",
"accessRequest",
"(",
"$",
"realm",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"default",
"=",
"array",
"(",
"'exclusive'",
"=>",
"false",
",",
"'passive'",
"=>",
"false",
",",
"'active'",
"=>",
"false",
",",
"'wr... | @param $realm
@param array $options
@return mixed|null
accessRequest($realm, array(
'exclusive' => false,
'passive' => false,
'active' => false,
'write' => false,
'read' => false)
) | [
"@param",
"$realm",
"@param",
"array",
"$options"
] | train | https://github.com/zircote/AMQP/blob/b96777b372f556797db4fd0ba02edb18d4bf4a1e/library/AMQP/Channel.php#L274-L285 |
zircote/AMQP | library/AMQP/Channel.php | Channel.accessRequestOk | protected function accessRequestOk(\AMQP\Wire\Reader $args)
{
$this->defaultTicket = $args->readShort();
return $this->defaultTicket;
} | php | protected function accessRequestOk(\AMQP\Wire\Reader $args)
{
$this->defaultTicket = $args->readShort();
return $this->defaultTicket;
} | [
"protected",
"function",
"accessRequestOk",
"(",
"\\",
"AMQP",
"\\",
"Wire",
"\\",
"Reader",
"$",
"args",
")",
"{",
"$",
"this",
"->",
"defaultTicket",
"=",
"$",
"args",
"->",
"readShort",
"(",
")",
";",
"return",
"$",
"this",
"->",
"defaultTicket",
";",... | grant access to server resources
@param \AMQP\Wire\Reader $args
@return int | [
"grant",
"access",
"to",
"server",
"resources"
] | train | https://github.com/zircote/AMQP/blob/b96777b372f556797db4fd0ba02edb18d4bf4a1e/library/AMQP/Channel.php#L294-L298 |
zircote/AMQP | library/AMQP/Channel.php | Channel.exchangeDeclare | public function exchangeDeclare($exchange, $type, $options = array())
{
$defaultArgs = array('passive' => false, 'durable' => false, 'auto_delete' => true,
'internal' => false, 'no_wait' => false, 'arguments' => array(), 'ticket' => null);
$options = array_merge($defaul... | php | public function exchangeDeclare($exchange, $type, $options = array())
{
$defaultArgs = array('passive' => false, 'durable' => false, 'auto_delete' => true,
'internal' => false, 'no_wait' => false, 'arguments' => array(), 'ticket' => null);
$options = array_merge($defaul... | [
"public",
"function",
"exchangeDeclare",
"(",
"$",
"exchange",
",",
"$",
"type",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"defaultArgs",
"=",
"array",
"(",
"'passive'",
"=>",
"false",
",",
"'durable'",
"=>",
"false",
",",
"'auto_delete... | @param $exchange
@param $type
@param array $options
@return mixed|null
exchangeDeclare($exchange, $type,
array(
'passive' => false,
'durable' => false,
'auto_delete' => true,
'internal' => false,
'no_wait' => false,
'arguments' => array(),
'ticket' => null)
) | [
"@param",
"$exchange",
"@param",
"$type",
"@param",
"array",
"$options"
] | train | https://github.com/zircote/AMQP/blob/b96777b372f556797db4fd0ba02edb18d4bf4a1e/library/AMQP/Channel.php#L318-L336 |
zircote/AMQP | library/AMQP/Channel.php | Channel.exchangeDelete | public function exchangeDelete($exchange, $options=array())
{
$default = array('if_unused' => false, 'no_wait' => false, 'ticket' => null);
$options = array_merge($default, $options);
$options['ticket'] = $this->getTicket($options['ticket']);
$args = $this->frameBuilder->exchangeDele... | php | public function exchangeDelete($exchange, $options=array())
{
$default = array('if_unused' => false, 'no_wait' => false, 'ticket' => null);
$options = array_merge($default, $options);
$options['ticket'] = $this->getTicket($options['ticket']);
$args = $this->frameBuilder->exchangeDele... | [
"public",
"function",
"exchangeDelete",
"(",
"$",
"exchange",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"default",
"=",
"array",
"(",
"'if_unused'",
"=>",
"false",
",",
"'no_wait'",
"=>",
"false",
",",
"'ticket'",
"=>",
"null",
")",
"... | @param $exchange
@param array $options
@return mixed|null
exchangeDelete($exchange, array(
'if_unused' => false,
'no_wait' => false,
'ticket' => null)
); | [
"@param",
"$exchange",
"@param",
"array",
"$options"
] | train | https://github.com/zircote/AMQP/blob/b96777b372f556797db4fd0ba02edb18d4bf4a1e/library/AMQP/Channel.php#L360-L376 |
zircote/AMQP | library/AMQP/Channel.php | Channel.queueBind | public function queueBind($queue, $exchange, $options=array())
{
$default = array('routing_key' => '', 'no_wait' => false, 'arguments' => array(), 'ticket' => null);
$options = array_merge($default, $options);
$options['arguments'] = $this->getArguments($options['arguments']);
$optio... | php | public function queueBind($queue, $exchange, $options=array())
{
$default = array('routing_key' => '', 'no_wait' => false, 'arguments' => array(), 'ticket' => null);
$options = array_merge($default, $options);
$options['arguments'] = $this->getArguments($options['arguments']);
$optio... | [
"public",
"function",
"queueBind",
"(",
"$",
"queue",
",",
"$",
"exchange",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"default",
"=",
"array",
"(",
"'routing_key'",
"=>",
"''",
",",
"'no_wait'",
"=>",
"false",
",",
"'arguments'",
"=>"... | @param $queue
@param $exchange
@param array $options
@return mixed|null
queueBind($queue, $exchange,
array(
'routing_key' => '',
'no_wait' => false,
'arguments' => array(),
'ticket' => null
)
) | [
"@param",
"$queue",
"@param",
"$exchange",
"@param",
"array",
"$options"
] | train | https://github.com/zircote/AMQP/blob/b96777b372f556797db4fd0ba02edb18d4bf4a1e/library/AMQP/Channel.php#L404-L423 |
zircote/AMQP | library/AMQP/Channel.php | Channel.queueDeclare | public function queueDeclare($options = array())
{
$default = array('queue' => '', 'passive' => false, 'durable' => false, 'exclusive' => false,
'auto_delete' => true, 'no_wait' => false, 'arguments' => array(), 'ticket' => null);
$options = array_merge($default, $options);
$options[... | php | public function queueDeclare($options = array())
{
$default = array('queue' => '', 'passive' => false, 'durable' => false, 'exclusive' => false,
'auto_delete' => true, 'no_wait' => false, 'arguments' => array(), 'ticket' => null);
$options = array_merge($default, $options);
$options[... | [
"public",
"function",
"queueDeclare",
"(",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"default",
"=",
"array",
"(",
"'queue'",
"=>",
"''",
",",
"'passive'",
"=>",
"false",
",",
"'durable'",
"=>",
"false",
",",
"'exclusive'",
"=>",
"false",
... | @param array $options
@return mixed|null
queueDeclare(array(
'queue' => '',
'passive' => false,
'durable' => false,
'exclusive' => false,
'auto_delete' => true,
'no_wait' => false,
'arguments' => array(),
'ticket' => null
)); | [
"@param",
"array",
"$options"
] | train | https://github.com/zircote/AMQP/blob/b96777b372f556797db4fd0ba02edb18d4bf4a1e/library/AMQP/Channel.php#L487-L505 |
zircote/AMQP | library/AMQP/Channel.php | Channel.queueDeclareOk | protected function queueDeclareOk(\AMQP\Wire\Reader $args)
{
$queue = $args->readShortstr();
$messageCount = $args->readLong();
$consumerCount = $args->readLong();
return array($queue, $messageCount, $consumerCount);
} | php | protected function queueDeclareOk(\AMQP\Wire\Reader $args)
{
$queue = $args->readShortstr();
$messageCount = $args->readLong();
$consumerCount = $args->readLong();
return array($queue, $messageCount, $consumerCount);
} | [
"protected",
"function",
"queueDeclareOk",
"(",
"\\",
"AMQP",
"\\",
"Wire",
"\\",
"Reader",
"$",
"args",
")",
"{",
"$",
"queue",
"=",
"$",
"args",
"->",
"readShortstr",
"(",
")",
";",
"$",
"messageCount",
"=",
"$",
"args",
"->",
"readLong",
"(",
")",
... | confirms a queue definition
@param \AMQP\Wire\Reader $args
@return array | [
"confirms",
"a",
"queue",
"definition"
] | train | https://github.com/zircote/AMQP/blob/b96777b372f556797db4fd0ba02edb18d4bf4a1e/library/AMQP/Channel.php#L514-L521 |
zircote/AMQP | library/AMQP/Channel.php | Channel.queuePurge | public function queuePurge($options = array())
{
$default = array('queue' => '', 'no_wait' => false, 'ticket' => null);
$options = array_merge($default, $options);
$options['ticket'] = $this->getTicket($options['ticket']);
$args = $this->frameBuilder->queuePurge($options);
$... | php | public function queuePurge($options = array())
{
$default = array('queue' => '', 'no_wait' => false, 'ticket' => null);
$options = array_merge($default, $options);
$options['ticket'] = $this->getTicket($options['ticket']);
$args = $this->frameBuilder->queuePurge($options);
$... | [
"public",
"function",
"queuePurge",
"(",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"default",
"=",
"array",
"(",
"'queue'",
"=>",
"''",
",",
"'no_wait'",
"=>",
"false",
",",
"'ticket'",
"=>",
"null",
")",
";",
"$",
"options",
"=",
"array... | @param array $options
@return mixed|null
queuePurge(array(
'queue' => '',
'no_wait' => false,
'ticket' => null)
) | [
"@param",
"array",
"$options"
] | train | https://github.com/zircote/AMQP/blob/b96777b372f556797db4fd0ba02edb18d4bf4a1e/library/AMQP/Channel.php#L579-L596 |
zircote/AMQP | library/AMQP/Channel.php | Channel.basicCancel | public function basicCancel($consumerTag, $nowait = false)
{
$args = $this->frameBuilder->basicCancel($consumerTag, $nowait);
$this->sendMethodFrame(array(60, 30), $args);
return $this->wait(
array(
"60,31" // Channel.basicCancelOk
)
);
} | php | public function basicCancel($consumerTag, $nowait = false)
{
$args = $this->frameBuilder->basicCancel($consumerTag, $nowait);
$this->sendMethodFrame(array(60, 30), $args);
return $this->wait(
array(
"60,31" // Channel.basicCancelOk
)
);
} | [
"public",
"function",
"basicCancel",
"(",
"$",
"consumerTag",
",",
"$",
"nowait",
"=",
"false",
")",
"{",
"$",
"args",
"=",
"$",
"this",
"->",
"frameBuilder",
"->",
"basicCancel",
"(",
"$",
"consumerTag",
",",
"$",
"nowait",
")",
";",
"$",
"this",
"->"... | end a queue consumer
@param $consumerTag
@param bool $nowait
@return mixed|null | [
"end",
"a",
"queue",
"consumer"
] | train | https://github.com/zircote/AMQP/blob/b96777b372f556797db4fd0ba02edb18d4bf4a1e/library/AMQP/Channel.php#L628-L637 |
zircote/AMQP | library/AMQP/Channel.php | Channel.basicConsume | public function basicConsume($options = array())
{
$consumerTag = null;
$default = array('queue' => '', 'consumer_tag' => '', 'no_local' => false, 'no_ack' => false, 'exclusive' => false,
'no_wait' => false, 'callback' => null, 'ticket' => null);
$options = array_mer... | php | public function basicConsume($options = array())
{
$consumerTag = null;
$default = array('queue' => '', 'consumer_tag' => '', 'no_local' => false, 'no_ack' => false, 'exclusive' => false,
'no_wait' => false, 'callback' => null, 'ticket' => null);
$options = array_mer... | [
"public",
"function",
"basicConsume",
"(",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"consumerTag",
"=",
"null",
";",
"$",
"default",
"=",
"array",
"(",
"'queue'",
"=>",
"''",
",",
"'consumer_tag'",
"=>",
"''",
",",
"'no_local'",
"=>",
"fa... | @param array $options
@return mixed|null
basicConsume(
array(
'queue' => '',
'consumer_tag' => '',
'no_local' => false,
'no_ack' => false,
'exclusive' => false,
'no_wait' => false,
'callback' => null,
'ticket' => null
)
) | [
"@param",
"array",
"$options"
] | train | https://github.com/zircote/AMQP/blob/b96777b372f556797db4fd0ba02edb18d4bf4a1e/library/AMQP/Channel.php#L666-L687 |
zircote/AMQP | library/AMQP/Channel.php | Channel.basicGetOk | protected function basicGetOk(\AMQP\Wire\Reader $args, \AMQP\Message $msg)
{
$deliveryTag = $args->readLonglong();
$redelivered = $args->readBit();
$exchange = $args->readShortstr();
$routingKey = $args->readShortstr();
$messageCount = $args->readLong();
$msg->delive... | php | protected function basicGetOk(\AMQP\Wire\Reader $args, \AMQP\Message $msg)
{
$deliveryTag = $args->readLonglong();
$redelivered = $args->readBit();
$exchange = $args->readShortstr();
$routingKey = $args->readShortstr();
$messageCount = $args->readLong();
$msg->delive... | [
"protected",
"function",
"basicGetOk",
"(",
"\\",
"AMQP",
"\\",
"Wire",
"\\",
"Reader",
"$",
"args",
",",
"\\",
"AMQP",
"\\",
"Message",
"$",
"msg",
")",
"{",
"$",
"deliveryTag",
"=",
"$",
"args",
"->",
"readLonglong",
"(",
")",
";",
"$",
"redelivered"... | @param Wire\Reader $args
@param Message $msg
@return Message | [
"@param",
"Wire",
"\\",
"Reader",
"$args",
"@param",
"Message",
"$msg"
] | train | https://github.com/zircote/AMQP/blob/b96777b372f556797db4fd0ba02edb18d4bf4a1e/library/AMQP/Channel.php#L776-L792 |
zircote/AMQP | library/AMQP/Channel.php | Channel.basicPublish | public function basicPublish( \AMQP\Message $msg, $options = array())
{
$default = array('exchange' => '', 'routing_key' => '', 'mandatory' => false, 'immediate' => false,
'ticket' => null);
$options = array_merge($default, $options);
$options['ticket'] = $this->getT... | php | public function basicPublish( \AMQP\Message $msg, $options = array())
{
$default = array('exchange' => '', 'routing_key' => '', 'mandatory' => false, 'immediate' => false,
'ticket' => null);
$options = array_merge($default, $options);
$options['ticket'] = $this->getT... | [
"public",
"function",
"basicPublish",
"(",
"\\",
"AMQP",
"\\",
"Message",
"$",
"msg",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"default",
"=",
"array",
"(",
"'exchange'",
"=>",
"''",
",",
"'routing_key'",
"=>",
"''",
",",
"'mandatory... | @param Message $msg
@param array $options
basicPublish($msg,
array(
'exchange' => '',
'routing_key' => '',
'mandatory' => false,
'immediate' => false,
'ticket' => null)
) | [
"@param",
"Message",
"$msg",
"@param",
"array",
"$options"
] | train | https://github.com/zircote/AMQP/blob/b96777b372f556797db4fd0ba02edb18d4bf4a1e/library/AMQP/Channel.php#L807-L823 |
zircote/AMQP | library/AMQP/Channel.php | Channel.basicQos | public function basicQos($prefetchSize, $prefetchCount, $aGlobal)
{
$args = $this->frameBuilder->basicQos(
$prefetchSize, $prefetchCount, $aGlobal
);
$this->sendMethodFrame(array(60, 10), $args);
return $this->wait(
array(
"60,11" //Channel.ba... | php | public function basicQos($prefetchSize, $prefetchCount, $aGlobal)
{
$args = $this->frameBuilder->basicQos(
$prefetchSize, $prefetchCount, $aGlobal
);
$this->sendMethodFrame(array(60, 10), $args);
return $this->wait(
array(
"60,11" //Channel.ba... | [
"public",
"function",
"basicQos",
"(",
"$",
"prefetchSize",
",",
"$",
"prefetchCount",
",",
"$",
"aGlobal",
")",
"{",
"$",
"args",
"=",
"$",
"this",
"->",
"frameBuilder",
"->",
"basicQos",
"(",
"$",
"prefetchSize",
",",
"$",
"prefetchCount",
",",
"$",
"a... | specify quality of service
@param $prefetchSize
@param $prefetchCount
@param $aGlobal
@return mixed|null | [
"specify",
"quality",
"of",
"service"
] | train | https://github.com/zircote/AMQP/blob/b96777b372f556797db4fd0ba02edb18d4bf4a1e/library/AMQP/Channel.php#L834-L845 |
zircote/AMQP | library/AMQP/Channel.php | Channel.basicRecover | public function basicRecover($reQueue = false)
{
$args = $this->frameBuilder->basicRecover($reQueue);
$this->sendMethodFrame(array(60, 100), $args);
} | php | public function basicRecover($reQueue = false)
{
$args = $this->frameBuilder->basicRecover($reQueue);
$this->sendMethodFrame(array(60, 100), $args);
} | [
"public",
"function",
"basicRecover",
"(",
"$",
"reQueue",
"=",
"false",
")",
"{",
"$",
"args",
"=",
"$",
"this",
"->",
"frameBuilder",
"->",
"basicRecover",
"(",
"$",
"reQueue",
")",
";",
"$",
"this",
"->",
"sendMethodFrame",
"(",
"array",
"(",
"60",
... | redeliver unacknowledged messages
@param bool $reQueue | [
"redeliver",
"unacknowledged",
"messages"
] | train | https://github.com/zircote/AMQP/blob/b96777b372f556797db4fd0ba02edb18d4bf4a1e/library/AMQP/Channel.php#L861-L865 |
zircote/AMQP | library/AMQP/Channel.php | Channel.basicReject | public function basicReject($deliveryTag, $reQueue)
{
$args = $this->frameBuilder->basicReject($deliveryTag, $reQueue);
$this->sendMethodFrame(array(60, 90), $args);
} | php | public function basicReject($deliveryTag, $reQueue)
{
$args = $this->frameBuilder->basicReject($deliveryTag, $reQueue);
$this->sendMethodFrame(array(60, 90), $args);
} | [
"public",
"function",
"basicReject",
"(",
"$",
"deliveryTag",
",",
"$",
"reQueue",
")",
"{",
"$",
"args",
"=",
"$",
"this",
"->",
"frameBuilder",
"->",
"basicReject",
"(",
"$",
"deliveryTag",
",",
"$",
"reQueue",
")",
";",
"$",
"this",
"->",
"sendMethodF... | reject an incoming message
@param $deliveryTag
@param $reQueue | [
"reject",
"an",
"incoming",
"message"
] | train | https://github.com/zircote/AMQP/blob/b96777b372f556797db4fd0ba02edb18d4bf4a1e/library/AMQP/Channel.php#L873-L877 |
zircote/AMQP | library/AMQP/Channel.php | Channel.basicReturn | protected function basicReturn(\AMQP\Wire\Reader $args)
{
$reply_code = $args->readShort();
$reply_text = $args->readShortstr();
$exchange = $args->readShortstr();
$routing_key = $args->readShortstr();
$msg = $this->wait();
} | php | protected function basicReturn(\AMQP\Wire\Reader $args)
{
$reply_code = $args->readShort();
$reply_text = $args->readShortstr();
$exchange = $args->readShortstr();
$routing_key = $args->readShortstr();
$msg = $this->wait();
} | [
"protected",
"function",
"basicReturn",
"(",
"\\",
"AMQP",
"\\",
"Wire",
"\\",
"Reader",
"$",
"args",
")",
"{",
"$",
"reply_code",
"=",
"$",
"args",
"->",
"readShort",
"(",
")",
";",
"$",
"reply_text",
"=",
"$",
"args",
"->",
"readShortstr",
"(",
")",
... | return a failed message
@param \AMQP\Wire\Reader $args | [
"return",
"a",
"failed",
"message"
] | train | https://github.com/zircote/AMQP/blob/b96777b372f556797db4fd0ba02edb18d4bf4a1e/library/AMQP/Channel.php#L884-L891 |
shrink0r/workflux | src/Param/Output.php | Output.withCurrentState | public function withCurrentState(string $current_state): OutputInterface
{
$output = clone $this;
$output->current_state = $current_state;
return $output;
} | php | public function withCurrentState(string $current_state): OutputInterface
{
$output = clone $this;
$output->current_state = $current_state;
return $output;
} | [
"public",
"function",
"withCurrentState",
"(",
"string",
"$",
"current_state",
")",
":",
"OutputInterface",
"{",
"$",
"output",
"=",
"clone",
"$",
"this",
";",
"$",
"output",
"->",
"current_state",
"=",
"$",
"current_state",
";",
"return",
"$",
"output",
";"... | @param string $current_state
@return OutputInterface | [
"@param",
"string",
"$current_state"
] | train | https://github.com/shrink0r/workflux/blob/008f45c64f52b1f795ab7f6ddbfc1a55580254d9/src/Param/Output.php#L41-L46 |
spiral-modules/scaffolder | source/Scaffolder/Commands/ControllerCommand.php | ControllerCommand.perform | public function perform()
{
/** @var ControllerDeclaration $declaration */
$declaration = $this->createDeclaration();
foreach ($this->option('action') as $action) {
$declaration->addAction($action);
}
$this->writeDeclaration($declaration);
} | php | public function perform()
{
/** @var ControllerDeclaration $declaration */
$declaration = $this->createDeclaration();
foreach ($this->option('action') as $action) {
$declaration->addAction($action);
}
$this->writeDeclaration($declaration);
} | [
"public",
"function",
"perform",
"(",
")",
"{",
"/** @var ControllerDeclaration $declaration */",
"$",
"declaration",
"=",
"$",
"this",
"->",
"createDeclaration",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"option",
"(",
"'action'",
")",
"as",
"$",
"act... | Create controller declaration. | [
"Create",
"controller",
"declaration",
"."
] | train | https://github.com/spiral-modules/scaffolder/blob/9be9dd0da6e4b02232db24e797fe5c288afbbddf/source/Scaffolder/Commands/ControllerCommand.php#L35-L45 |
joseph-walker/vector | src/Lib/Lambda.php | Lambda.__flip | protected static function __flip($f)
{
return self::curry(function($a, $b) use ($f) {
return $f($b, $a);
});
} | php | protected static function __flip($f)
{
return self::curry(function($a, $b) use ($f) {
return $f($b, $a);
});
} | [
"protected",
"static",
"function",
"__flip",
"(",
"$",
"f",
")",
"{",
"return",
"self",
"::",
"curry",
"(",
"function",
"(",
"$",
"a",
",",
"$",
"b",
")",
"use",
"(",
"$",
"f",
")",
"{",
"return",
"$",
"f",
"(",
"$",
"b",
",",
"$",
"a",
")",
... | Flip Combinator
Given a function that takes two arguments, return a new function that
takes those two arguments with their order reversed.
@example
Math::subtract(2, 6); // 4
Lambda::flip(Math::subtract())(2, 6); // -4
@type (a -> b -> c) -> b -> a -> c
@param \Closure $f Function to flip
@return \Closure Flipp... | [
"Flip",
"Combinator"
] | train | https://github.com/joseph-walker/vector/blob/e349aa2e9e0535b1993f9fffc0476e7fd8e113fc/src/Lib/Lambda.php#L58-L63 |
barebone-php/barebone-core | lib/Router.php | Router.instance | public static function instance()
{
if (null === self::$_instance) {
$routeCollector = new RouteCollector(
new \FastRoute\RouteParser\Std,
new \FastRoute\DataGenerator\GroupCountBased
);
self::$_instance = $routeCollector;
}
... | php | public static function instance()
{
if (null === self::$_instance) {
$routeCollector = new RouteCollector(
new \FastRoute\RouteParser\Std,
new \FastRoute\DataGenerator\GroupCountBased
);
self::$_instance = $routeCollector;
}
... | [
"public",
"static",
"function",
"instance",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"self",
"::",
"$",
"_instance",
")",
"{",
"$",
"routeCollector",
"=",
"new",
"RouteCollector",
"(",
"new",
"\\",
"FastRoute",
"\\",
"RouteParser",
"\\",
"Std",
",",
"new... | Instantiate Router or return $instance
@return RouteCollector | [
"Instantiate",
"Router",
"or",
"return",
"$instance"
] | train | https://github.com/barebone-php/barebone-core/blob/7fda3a62d5fa103cdc4d2d34e1adf8f3ccbfe2bc/lib/Router.php#L50-L60 |
barebone-php/barebone-core | lib/Router.php | Router.dispatch | public static function dispatch()
{
$vars = [];
$request = Request::createFromGlobals();
$dispatcher = new Dispatcher(static::instance()->getData());
$routeInfo = $dispatcher->dispatch(
$request->getMethod(),
$request->getUri()->getPath()
);
... | php | public static function dispatch()
{
$vars = [];
$request = Request::createFromGlobals();
$dispatcher = new Dispatcher(static::instance()->getData());
$routeInfo = $dispatcher->dispatch(
$request->getMethod(),
$request->getUri()->getPath()
);
... | [
"public",
"static",
"function",
"dispatch",
"(",
")",
"{",
"$",
"vars",
"=",
"[",
"]",
";",
"$",
"request",
"=",
"Request",
"::",
"createFromGlobals",
"(",
")",
";",
"$",
"dispatcher",
"=",
"new",
"Dispatcher",
"(",
"static",
"::",
"instance",
"(",
")"... | Start router and parse incoming requests
@return \Zend\Diactoros\Response | [
"Start",
"router",
"and",
"parse",
"incoming",
"requests"
] | train | https://github.com/barebone-php/barebone-core/blob/7fda3a62d5fa103cdc4d2d34e1adf8f3ccbfe2bc/lib/Router.php#L67-L147 |
barebone-php/barebone-core | lib/Router.php | Router.callback | protected static function callback($callback)
{
if (is_string($callback)) {
// default format is "ControllerClassName:action"
if (strpos($callback, ':')) {
// automatically prefix namespace on callbacks not starting with '\'
if ($callback{0} !== '\\') ... | php | protected static function callback($callback)
{
if (is_string($callback)) {
// default format is "ControllerClassName:action"
if (strpos($callback, ':')) {
// automatically prefix namespace on callbacks not starting with '\'
if ($callback{0} !== '\\') ... | [
"protected",
"static",
"function",
"callback",
"(",
"$",
"callback",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"callback",
")",
")",
"{",
"// default format is \"ControllerClassName:action\"",
"if",
"(",
"strpos",
"(",
"$",
"callback",
",",
"':'",
")",
")",
... | We assume to receive a string with namespace prefix (starting with backslash).
If the initial backslash is missing, we prefix \App\Controller
namespace to allow for shorter controller callbacks.
@param mixed $callback "MyController:method" or array(class,method)
@throws \LogicException
@return array | [
"We",
"assume",
"to",
"receive",
"a",
"string",
"with",
"namespace",
"prefix",
"(",
"starting",
"with",
"backslash",
")",
"."
] | train | https://github.com/barebone-php/barebone-core/blob/7fda3a62d5fa103cdc4d2d34e1adf8f3ccbfe2bc/lib/Router.php#L160-L182 |
barebone-php/barebone-core | lib/Router.php | Router.get | public static function get($path, $callback)
{
self::instance()->addRoute('GET', $path, self::callback($callback));
} | php | public static function get($path, $callback)
{
self::instance()->addRoute('GET', $path, self::callback($callback));
} | [
"public",
"static",
"function",
"get",
"(",
"$",
"path",
",",
"$",
"callback",
")",
"{",
"self",
"::",
"instance",
"(",
")",
"->",
"addRoute",
"(",
"'GET'",
",",
"$",
"path",
",",
"self",
"::",
"callback",
"(",
"$",
"callback",
")",
")",
";",
"}"
] | Handle GET HTTP requests
@param string $path URL segments and placeholders
@param mixed $callback "MyController:method" or array(class,method)
@return void | [
"Handle",
"GET",
"HTTP",
"requests"
] | train | https://github.com/barebone-php/barebone-core/blob/7fda3a62d5fa103cdc4d2d34e1adf8f3ccbfe2bc/lib/Router.php#L192-L195 |
barebone-php/barebone-core | lib/Router.php | Router.post | public static function post($path, $callback)
{
self::instance()->addRoute('POST', $path, self::callback($callback));
} | php | public static function post($path, $callback)
{
self::instance()->addRoute('POST', $path, self::callback($callback));
} | [
"public",
"static",
"function",
"post",
"(",
"$",
"path",
",",
"$",
"callback",
")",
"{",
"self",
"::",
"instance",
"(",
")",
"->",
"addRoute",
"(",
"'POST'",
",",
"$",
"path",
",",
"self",
"::",
"callback",
"(",
"$",
"callback",
")",
")",
";",
"}"... | Handle POST HTTP requests
@param string $path URL segments and placeholders
@param mixed $callback "MyController:method" or array(class,method)
@return void | [
"Handle",
"POST",
"HTTP",
"requests"
] | train | https://github.com/barebone-php/barebone-core/blob/7fda3a62d5fa103cdc4d2d34e1adf8f3ccbfe2bc/lib/Router.php#L205-L208 |
barebone-php/barebone-core | lib/Router.php | Router.put | public static function put($path, $callback)
{
self::instance()->addRoute('PUT', $path, self::callback($callback));
} | php | public static function put($path, $callback)
{
self::instance()->addRoute('PUT', $path, self::callback($callback));
} | [
"public",
"static",
"function",
"put",
"(",
"$",
"path",
",",
"$",
"callback",
")",
"{",
"self",
"::",
"instance",
"(",
")",
"->",
"addRoute",
"(",
"'PUT'",
",",
"$",
"path",
",",
"self",
"::",
"callback",
"(",
"$",
"callback",
")",
")",
";",
"}"
] | Handle PUT HTTP requests
@param string $path URL segments and placeholders
@param mixed $callback "MyController:method" or array(class,method)
@return void | [
"Handle",
"PUT",
"HTTP",
"requests"
] | train | https://github.com/barebone-php/barebone-core/blob/7fda3a62d5fa103cdc4d2d34e1adf8f3ccbfe2bc/lib/Router.php#L218-L221 |
barebone-php/barebone-core | lib/Router.php | Router.delete | public static function delete($path, $callback)
{
self::instance()->addRoute('DELETE', $path, self::callback($callback));
} | php | public static function delete($path, $callback)
{
self::instance()->addRoute('DELETE', $path, self::callback($callback));
} | [
"public",
"static",
"function",
"delete",
"(",
"$",
"path",
",",
"$",
"callback",
")",
"{",
"self",
"::",
"instance",
"(",
")",
"->",
"addRoute",
"(",
"'DELETE'",
",",
"$",
"path",
",",
"self",
"::",
"callback",
"(",
"$",
"callback",
")",
")",
";",
... | Handle DELETE HTTP requests
@param string $path URL segments and placeholders
@param mixed $callback "MyController:method" or array(class,method)
@return void | [
"Handle",
"DELETE",
"HTTP",
"requests"
] | train | https://github.com/barebone-php/barebone-core/blob/7fda3a62d5fa103cdc4d2d34e1adf8f3ccbfe2bc/lib/Router.php#L231-L234 |
barebone-php/barebone-core | lib/Router.php | Router.patch | public static function patch($path, $callback)
{
self::instance()->addRoute('PATCH', $path, self::callback($callback));
} | php | public static function patch($path, $callback)
{
self::instance()->addRoute('PATCH', $path, self::callback($callback));
} | [
"public",
"static",
"function",
"patch",
"(",
"$",
"path",
",",
"$",
"callback",
")",
"{",
"self",
"::",
"instance",
"(",
")",
"->",
"addRoute",
"(",
"'PATCH'",
",",
"$",
"path",
",",
"self",
"::",
"callback",
"(",
"$",
"callback",
")",
")",
";",
"... | Handle PATCH HTTP requests
@param string $path URL segments and placeholders
@param mixed $callback "MyController:method" or array(class,method)
@return void | [
"Handle",
"PATCH",
"HTTP",
"requests"
] | train | https://github.com/barebone-php/barebone-core/blob/7fda3a62d5fa103cdc4d2d34e1adf8f3ccbfe2bc/lib/Router.php#L244-L247 |
barebone-php/barebone-core | lib/Router.php | Router.options | public static function options($path, $callback)
{
self::instance()->addRoute('OPTIONS', $path, self::callback($callback));
} | php | public static function options($path, $callback)
{
self::instance()->addRoute('OPTIONS', $path, self::callback($callback));
} | [
"public",
"static",
"function",
"options",
"(",
"$",
"path",
",",
"$",
"callback",
")",
"{",
"self",
"::",
"instance",
"(",
")",
"->",
"addRoute",
"(",
"'OPTIONS'",
",",
"$",
"path",
",",
"self",
"::",
"callback",
"(",
"$",
"callback",
")",
")",
";",... | Handle OPTIONS HTTP requests
@param string $path URL segments and placeholders
@param mixed $callback "MyController:method" or array(class,method)
@return void | [
"Handle",
"OPTIONS",
"HTTP",
"requests"
] | train | https://github.com/barebone-php/barebone-core/blob/7fda3a62d5fa103cdc4d2d34e1adf8f3ccbfe2bc/lib/Router.php#L257-L260 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.