Download the PHP package roastrofficial-ctrl/xphp without Composer

On this page you can find all versions of the php package roastrofficial-ctrl/xphp. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package xphp

xphp

Write strict PHP without the boilerplate.

Every .xphp file automatically gets <?php declare(strict_types=1); — you never have to type it again.

Installation

That's it. After composer install, the package:

Usage

Rename any .php file to .xphp and drop the opening boilerplate. The autoloader picks up your existing PSR-4 mappings from composer.json, so App\Services\UserService maps to src/Services/UserService.xphp exactly as you'd expect.

Troubleshooting: If vendor/bin/xphp-ide --force prints Could not find autoload.php, run composer install and ensure you're in your project root where vendor/ and composer.json exist.

If you are using this package in development mode (from the package source tree), run:

Files can start with raw code, or keep <?php if your editor needs it for syntax highlighting — both work:

Linting

Auto-detection of linters

xphp-lint automatically detects and runs any of these tools if they're installed in your project:

Linter Docs What it checks
php -l N/A Syntax errors (always runs)
pint laravel/pint Code style & formatting
phpstan phpstan.org Static type analysis
psalm psalm.dev Static type analysis + runtime errors

Zero configuration. If you have vendor/bin/pint in your project, it runs automatically on xphp-lint — with the .xphp file header transparently injected so all checks work correctly.

Examples

With only syntax checking (default):

With pint + syntax checking:

With pint, phpstan, and syntax checking:

If a file fails any check, all failing checks are reported:

The lint command integrates seamlessly with your existing tooling — just install pint, phpstan, or psalm normally, and xphp-lint will pick them up automatically.

IDE Config

IDE config is written automatically after composer install. To re-run it manually:

What gets written

File Purpose
.idea/fileTypes/xphp.xml PhpStorm: treat .xphp as PHP
.vscode/settings.json VS Code/Cursor + Intelephense: treat .xphp as PHP
psalm.xml Psalm: scan .xphp files (if Psalm is installed)
phpstan.neon PHPStan: scan .xphp files (if PHPStan is installed)

These files are safe to commit to version control.

How it works

When PHP's autoloader encounters App\Services\UserService, it:

  1. Resolves the class to src/Services/UserService.xphp
  2. Loads the file via include 'xphp://...'
  3. The xphp:// stream wrapper intercepts, prepends the strict types header
  4. PHP compiles it — strict types enforced, no boilerplate ever written

The stream wrapper approach is used internally by Laravel, Psalm, and others. It carries no meaningful performance overhead.

Xdebug & line numbers

The header is injected on the same line as <?php (or as a single prepended line), so line numbers stay accurate for Xdebug.

Static analysis

PHPStan and Psalm will scan .xphp files after composer install. Since the strict types declaration is injected at runtime, not present in the source, you may want to tell your analyser to assume it globally:

Psalm: add useStrictTypes="true" to <psalm> in psalm.xml.

PHPStan: this is the default behaviour in strict mode (--level=max).

Running with lint command

Both tools are automatically integrated into vendor/bin/xphp-lint if installed:

No additional setup needed — the lint command handles header injection and transparently passes .xphp files to your analyser.

License

MIT


All versions of xphp with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package roastrofficial-ctrl/xphp contains the following files

Loading the files please wait ...