Dagger
Search

php-sdk-dev

Toolchain to develop the Dagger PHP SDK (experimental)

Installation

dagger install github.com/shykes/dagger/toolchains/php-sdk-dev@7ec44c64b509793d2a722ebdfef94a77dbcdcefe

Entrypoint

Return Type
PhpSdkDev !
Arguments
NameTypeDefault ValueDescription
workspaceDirectory -A directory with all the files needed to develop the SDK
sourcePathString !"sdk/php"The path of the SDK source in the workspace
doctumConfigPathString !"docs/doctum-config.php"The path of the doctum config in the workspace
Example
dagger -m github.com/shykes/dagger/toolchains/php-sdk-dev@7ec44c64b509793d2a722ebdfef94a77dbcdcefe call \
 --source-path string --doctum-config-path string
func (m *MyModule) Example(sourcePath string, doctumConfigPath string) *dagger.PhpSdkDev  {
	return dag.
			PhpSdkDev(sourcePath, doctumConfigPath)
}
@function
def example(source_path: str, doctum_config_path: str) -> dagger.PhpSdkDev:
	return (
		dag.php_sdk_dev(source_path, doctum_config_path)
	)
@func()
example(sourcePath: string, doctumConfigPath: string): PhpSdkDev {
	return dag
		.phpSdkDev(sourcePath, doctumConfigPath)
}

Types

PhpSdkDev 🔗

baseContainer() 🔗

Return Type
Container !
Example
dagger -m github.com/shykes/dagger/toolchains/php-sdk-dev@7ec44c64b509793d2a722ebdfef94a77dbcdcefe call \
 --source-path string --doctum-config-path string base-container
func (m *MyModule) Example(sourcePath string, doctumConfigPath string) *dagger.Container  {
	return dag.
			PhpSdkDev(sourcePath, doctumConfigPath).
			BaseContainer()
}
@function
def example(source_path: str, doctum_config_path: str) -> dagger.Container:
	return (
		dag.php_sdk_dev(source_path, doctum_config_path)
		.base_container()
	)
@func()
example(sourcePath: string, doctumConfigPath: string): Container {
	return dag
		.phpSdkDev(sourcePath, doctumConfigPath)
		.baseContainer()
}

devContainer() 🔗

Returns the PHP SDK workspace mounted in a dev container, and working directory set to the SDK source

Return Type
Container !
Arguments
NameTypeDefault ValueDescription
runInstallBoolean !"false"Run composer install before returning the container
Example
dagger -m github.com/shykes/dagger/toolchains/php-sdk-dev@7ec44c64b509793d2a722ebdfef94a77dbcdcefe call \
 --source-path string --doctum-config-path string dev-container --run-install boolean
func (m *MyModule) Example(sourcePath string, doctumConfigPath string, runInstall bool) *dagger.Container  {
	return dag.
			PhpSdkDev(sourcePath, doctumConfigPath).
			DevContainer(runInstall)
}
@function
def example(source_path: str, doctum_config_path: str, run_install: bool) -> dagger.Container:
	return (
		dag.php_sdk_dev(source_path, doctum_config_path)
		.dev_container(run_install)
	)
@func()
example(sourcePath: string, doctumConfigPath: string, runInstall: boolean): Container {
	return dag
		.phpSdkDev(sourcePath, doctumConfigPath)
		.devContainer(runInstall)
}

source() 🔗

Source returns the source directory for the PHP SDK

Return Type
Directory !
Example
dagger -m github.com/shykes/dagger/toolchains/php-sdk-dev@7ec44c64b509793d2a722ebdfef94a77dbcdcefe call \
 --source-path string --doctum-config-path string source
func (m *MyModule) Example(sourcePath string, doctumConfigPath string) *dagger.Directory  {
	return dag.
			PhpSdkDev(sourcePath, doctumConfigPath).
			Source()
}
@function
def example(source_path: str, doctum_config_path: str) -> dagger.Directory:
	return (
		dag.php_sdk_dev(source_path, doctum_config_path)
		.source()
	)
@func()
example(sourcePath: string, doctumConfigPath: string): Directory {
	return dag
		.phpSdkDev(sourcePath, doctumConfigPath)
		.source()
}

doctumConfig() 🔗

DoctumConfig returns the doctum configuration file

Return Type
File !
Example
dagger -m github.com/shykes/dagger/toolchains/php-sdk-dev@7ec44c64b509793d2a722ebdfef94a77dbcdcefe call \
 --source-path string --doctum-config-path string doctum-config
func (m *MyModule) Example(sourcePath string, doctumConfigPath string) *dagger.File  {
	return dag.
			PhpSdkDev(sourcePath, doctumConfigPath).
			DoctumConfig()
}
@function
def example(source_path: str, doctum_config_path: str) -> dagger.File:
	return (
		dag.php_sdk_dev(source_path, doctum_config_path)
		.doctum_config()
	)
@func()
example(sourcePath: string, doctumConfigPath: string): File {
	return dag
		.phpSdkDev(sourcePath, doctumConfigPath)
		.doctumConfig()
}

phpCodeSniffer() 🔗

Lint the PHP code with PHP CodeSniffer (https://github.com/squizlabs/PHP_CodeSniffer)

Return Type
Void !
Example
dagger -m github.com/shykes/dagger/toolchains/php-sdk-dev@7ec44c64b509793d2a722ebdfef94a77dbcdcefe call \
 --source-path string --doctum-config-path string php-code-sniffer
func (m *MyModule) Example(ctx context.Context, sourcePath string, doctumConfigPath string)   {
	return dag.
			PhpSdkDev(sourcePath, doctumConfigPath).
			PhpCodeSniffer(ctx)
}
@function
async def example(source_path: str, doctum_config_path: str) -> None:
	return await (
		dag.php_sdk_dev(source_path, doctum_config_path)
		.php_code_sniffer()
	)
@func()
async example(sourcePath: string, doctumConfigPath: string): Promise<void> {
	return dag
		.phpSdkDev(sourcePath, doctumConfigPath)
		.phpCodeSniffer()
}

phpStan() 🔗

Analyze the PHP code with PHPStan (https://phpstan.org)

Return Type
Void !
Example
dagger -m github.com/shykes/dagger/toolchains/php-sdk-dev@7ec44c64b509793d2a722ebdfef94a77dbcdcefe call \
 --source-path string --doctum-config-path string php-stan
func (m *MyModule) Example(ctx context.Context, sourcePath string, doctumConfigPath string)   {
	return dag.
			PhpSdkDev(sourcePath, doctumConfigPath).
			PhpStan(ctx)
}
@function
async def example(source_path: str, doctum_config_path: str) -> None:
	return await (
		dag.php_sdk_dev(source_path, doctum_config_path)
		.php_stan()
	)
@func()
async example(sourcePath: string, doctumConfigPath: string): Promise<void> {
	return dag
		.phpSdkDev(sourcePath, doctumConfigPath)
		.phpStan()
}

test() 🔗

Test the PHP SDK with PHPUnit (https://phpunit.de/)

Return Type
Void !
Example
dagger -m github.com/shykes/dagger/toolchains/php-sdk-dev@7ec44c64b509793d2a722ebdfef94a77dbcdcefe call \
 --source-path string --doctum-config-path string test
func (m *MyModule) Example(ctx context.Context, sourcePath string, doctumConfigPath string)   {
	return dag.
			PhpSdkDev(sourcePath, doctumConfigPath).
			Test(ctx)
}
@function
async def example(source_path: str, doctum_config_path: str) -> None:
	return await (
		dag.php_sdk_dev(source_path, doctum_config_path)
		.test()
	)
@func()
async example(sourcePath: string, doctumConfigPath: string): Promise<void> {
	return dag
		.phpSdkDev(sourcePath, doctumConfigPath)
		.test()
}

generate() 🔗

Regenerate the PHP SDK API

Return Type
Changeset !
Example
dagger -m github.com/shykes/dagger/toolchains/php-sdk-dev@7ec44c64b509793d2a722ebdfef94a77dbcdcefe call \
 --source-path string --doctum-config-path string generate
func (m *MyModule) Example(sourcePath string, doctumConfigPath string) *dagger.Changeset  {
	return dag.
			PhpSdkDev(sourcePath, doctumConfigPath).
			Generate()
}
@function
def example(source_path: str, doctum_config_path: str) -> dagger.Changeset:
	return (
		dag.php_sdk_dev(source_path, doctum_config_path)
		.generate()
	)
@func()
example(sourcePath: string, doctumConfigPath: string): Changeset {
	return dag
		.phpSdkDev(sourcePath, doctumConfigPath)
		.generate()
}

changes() 🔗

Return Type
Changeset !
Example
dagger -m github.com/shykes/dagger/toolchains/php-sdk-dev@7ec44c64b509793d2a722ebdfef94a77dbcdcefe call \
 --source-path string --doctum-config-path string changes
func (m *MyModule) Example(sourcePath string, doctumConfigPath string) *dagger.Changeset  {
	return dag.
			PhpSdkDev(sourcePath, doctumConfigPath).
			Changes()
}
@function
def example(source_path: str, doctum_config_path: str) -> dagger.Changeset:
	return (
		dag.php_sdk_dev(source_path, doctum_config_path)
		.changes()
	)
@func()
example(sourcePath: string, doctumConfigPath: string): Changeset {
	return dag
		.phpSdkDev(sourcePath, doctumConfigPath)
		.changes()
}

withGeneratedClient() 🔗

Return Type
PhpSdkDev !
Example
dagger -m github.com/shykes/dagger/toolchains/php-sdk-dev@7ec44c64b509793d2a722ebdfef94a77dbcdcefe call \
 --source-path string --doctum-config-path string with-generated-client
func (m *MyModule) Example(sourcePath string, doctumConfigPath string) *dagger.PhpSdkDev  {
	return dag.
			PhpSdkDev(sourcePath, doctumConfigPath).
			WithGeneratedClient()
}
@function
def example(source_path: str, doctum_config_path: str) -> dagger.PhpSdkDev:
	return (
		dag.php_sdk_dev(source_path, doctum_config_path)
		.with_generated_client()
	)
@func()
example(sourcePath: string, doctumConfigPath: string): PhpSdkDev {
	return dag
		.phpSdkDev(sourcePath, doctumConfigPath)
		.withGeneratedClient()
}

withGeneratedDocs() 🔗

Generate reference docs from the generated client NOTE: it’s the caller’s responsibility to ensure the generated client is up-to-date (see WithGeneratedClient)

Return Type
PhpSdkDev !
Example
dagger -m github.com/shykes/dagger/toolchains/php-sdk-dev@7ec44c64b509793d2a722ebdfef94a77dbcdcefe call \
 --source-path string --doctum-config-path string with-generated-docs
func (m *MyModule) Example(sourcePath string, doctumConfigPath string) *dagger.PhpSdkDev  {
	return dag.
			PhpSdkDev(sourcePath, doctumConfigPath).
			WithGeneratedDocs()
}
@function
def example(source_path: str, doctum_config_path: str) -> dagger.PhpSdkDev:
	return (
		dag.php_sdk_dev(source_path, doctum_config_path)
		.with_generated_docs()
	)
@func()
example(sourcePath: string, doctumConfigPath: string): PhpSdkDev {
	return dag
		.phpSdkDev(sourcePath, doctumConfigPath)
		.withGeneratedDocs()
}

releaseDryRun() 🔗

Test the publishing process

Return Type
Void !
Arguments
NameTypeDefault ValueDescription
sourceRepoGitRepository -Source git repository to fake-release
sourceTagString !"HEAD"Source git tag to fake-release
destRemoteString !"https://github.com/dagger/dagger-php-sdk.git"Target git remote to fake-release *to*
Example
echo 'Custom types are not supported in shell examples'
func (m *MyModule) Example(ctx context.Context, sourcePath string, doctumConfigPath string, sourceTag string, destRemote string)   {
	return dag.
			PhpSdkDev(sourcePath, doctumConfigPath).
			ReleaseDryRun(ctxsourceTag, destRemote)
}
@function
async def example(source_path: str, doctum_config_path: str, source_tag: str, dest_remote: str) -> None:
	return await (
		dag.php_sdk_dev(source_path, doctum_config_path)
		.release_dry_run(source_tag, dest_remote)
	)
@func()
async example(sourcePath: string, doctumConfigPath: string, sourceTag: string, destRemote: string): Promise<void> {
	return dag
		.phpSdkDev(sourcePath, doctumConfigPath)
		.releaseDryRun(sourceTag, destRemote)
}

versionFromTag() 🔗

Get v1.2.3 from sdk/php/v1.2.3

Return Type
String !
Arguments
NameTypeDefault ValueDescription
tagString !-No description provided
Example
dagger -m github.com/shykes/dagger/toolchains/php-sdk-dev@7ec44c64b509793d2a722ebdfef94a77dbcdcefe call \
 --source-path string --doctum-config-path string version-from-tag --tag string
func (m *MyModule) Example(ctx context.Context, sourcePath string, doctumConfigPath string, tag string) string  {
	return dag.
			PhpSdkDev(sourcePath, doctumConfigPath).
			VersionFromTag(ctx, tag)
}
@function
async def example(source_path: str, doctum_config_path: str, tag: str) -> str:
	return await (
		dag.php_sdk_dev(source_path, doctum_config_path)
		.version_from_tag(tag)
	)
@func()
async example(sourcePath: string, doctumConfigPath: string, tag: string): Promise<string> {
	return dag
		.phpSdkDev(sourcePath, doctumConfigPath)
		.versionFromTag(tag)
}

release() 🔗

Publish the PHP SDK

Return Type
Void !
Arguments
NameTypeDefault ValueDescription
sourceRepoGitRepository -The source git repository to release
sourceTagString !-The source git tag to release
destString "https://github.com/dagger/dagger-php-sdk.git"No description provided
githubTokenSecret -No description provided
Example
echo 'Custom types are not supported in shell examples'
func (m *MyModule) Example(ctx context.Context, sourcePath string, doctumConfigPath string, sourceTag string)   {
	return dag.
			PhpSdkDev(sourcePath, doctumConfigPath).
			Release(ctxsourceTag)
}
@function
async def example(source_path: str, doctum_config_path: str, source_tag: str) -> None:
	return await (
		dag.php_sdk_dev(source_path, doctum_config_path)
		.release(source_tag)
	)
@func()
async example(sourcePath: string, doctumConfigPath: string, sourceTag: string): Promise<void> {
	return dag
		.phpSdkDev(sourcePath, doctumConfigPath)
		.release(sourceTag)
}

bump() 🔗

Bump the PHP SDK’s Engine dependency

Return Type
Changeset !
Arguments
NameTypeDefault ValueDescription
versionString !-No description provided
Example
dagger -m github.com/shykes/dagger/toolchains/php-sdk-dev@7ec44c64b509793d2a722ebdfef94a77dbcdcefe call \
 --source-path string --doctum-config-path string bump --version string
func (m *MyModule) Example(sourcePath string, doctumConfigPath string, version string) *dagger.Changeset  {
	return dag.
			PhpSdkDev(sourcePath, doctumConfigPath).
			Bump(version)
}
@function
def example(source_path: str, doctum_config_path: str, version: str) -> dagger.Changeset:
	return (
		dag.php_sdk_dev(source_path, doctum_config_path)
		.bump(version)
	)
@func()
example(sourcePath: string, doctumConfigPath: string, version: string): Changeset {
	return dag
		.phpSdkDev(sourcePath, doctumConfigPath)
		.bump(version)
}