Maintainers

Package info

gitlab.com/php-standard-library/release-packages/sdk

Issues

Type:standard-library-sdk

pkg:composer/standard-library/sdk

Transparency log

Statistics

Installs: 181

Dependents: 3

Suggesters: 0

Stars: 0

1.0.33 2026-08-11 15:56 UTC

This package is auto-updated.

Last update: 2026-08-11 18:06:54 UTC


README

Shared dev tooling for PHP Standard Library packages: linting, static analysis and testing. require it as a dev dependency and it exposes a set of commands under your project's bin/ directory (composer's bin-dir).

{
  "require-dev": {
    "standard-library/sdk": "^1.0"
  }
}

Commands

CommandPurpose
bin/composer-updateRun composer update inside the skpr/php-cli:8.5-v2-stable Docker image, mounting the current directory as /opt/project.
bin/sdkSymfony Console application entry point; runs directly on the host (no Docker).

bin/sdk commands

bin/sdk auto-registers commands from every installed composer package of type "standard-library-sdk" (sdk, sdk-application, sdk-framework, or any third-party package using the same type) that ships a config.yaml at its package root:

commands:
  - App\Console\SomeCommand

Each listed class must extend StandardLibrary\Sdk\Console\Command. sdk itself contributes:

CommandPurpose
bin/sdk infoPrints the text configured under its own FQN section in config-dev.yaml.
bin/sdk fixApply PHP-CS-Fixer fixes.
bin/sdk run:styleCheck code style with PHP-CS-Fixer (--dry-run).
bin/sdk run:stanRun PHPStan (level max), including the custom rules.
bin/sdk run:testsRun the PHPUnit test suite.

Don't confuse this package-root config.yaml (which commands a package provides) with config-dev.yaml in the consumer project root (the runtime configuration those commands read).

StandardLibrary\Sdk\Build\

Small, reusable pieces shared by build-flavoured standard-library-sdk packages (standard-library/sdk-application's directory build, standard-library/sdk-phar's PHAR build): BuildLogger/ConsoleBuildLogger (a one-method logging interface plus a STDOUT-writing default implementation), ProjectCopier (copies the project into a build directory via git clone, or git archive piped into tar when only specific dirs/files are selected, so uncommitted or gitignored files never leak into a build), and ComposerInstaller (composer install --no-dev --no-interaction in the build directory). They live here rather than in either build package so neither has to depend on the other just to reuse them.

Every bin/sdk command additionally accepts a global -d/--docker[=IMAGE] option. When given, bin/sdk re-runs itself inside a Docker container instead of on the host — mounting the current directory as /opt/project and running the same command (minus -d/--docker itself) there. IMAGE defaults to skpr/php-cli:8.5-v2-stable if omitted (-d/--docker with no value), e.g. bin/sdk info --docker or bin/sdk info --docker=my/other-image:tag.

Shell completion

bin/sdk gets shell tab-completion for free from Symfony Console's built-in completion command:

bin/sdk completion zsh > ~/.zfunc/_sdk   # once, assuming ~/.zfunc is on fpath
# or:
echo 'eval "$(bin/sdk completion zsh)"' >> ~/.zshrc

(bash/fish work the same way via bin/sdk completion bash/fish.) This covers command names and options out of the box. Commands whose argument values come from config-dev.yaml (e.g. deploy <environment>) additionally suggest those via Command::suggestConfigKeys() — a closure passed as addArgument()'s $suggestedValues, returning the top-level keys of that command's own FQN section.