Download the PHP package rector/swiss-knife without Composer

On this page you can find all versions of the php package rector/swiss-knife. 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 swiss-knife

Swiss Knife for Upgrades

Downloads total

Swiss knife in the pocket of every upgrade architect!


Install




Usage


1. Check your Code for Git Merge Conflicts

Do you use Git? Then merge conflict markers are the last thing you want to see in pushed code:

Add this command to CI to spot these:

You can skip paths with the --exclude option:


2. Detect Commented Code

Have you ever forgotten commented code in your project?

No more! Add this command to CI to spot these:


3. Reach full PSR-4

Find multiple classes in single file

To make PSR-4 work properly, each class must be in its own file. This command makes it easy to spot multiple classes in a single file:


Update Namespace to match PSR-4 Root

Is your class in wrong namespace? Make it match your PSR-4 root:

This will update all files in your /src directory, to starts with App\\ and follow full PSR-4 path:


4. Finalize classes without children

Do you want to finalize all classes that don't have children?

Do you use mocks but not bypass final yet?

This will keep mocked classes non-final, so PHPUnit can extend them internally.


Do you want to skip file or two?

Skip is also support with fnmatch() patterns:


5. Privatize local class constants

PHPStan can report unused private class constants, but it skips all the public ones. Do you have lots of class constants, all of them public but want to narrow scope to privates?

This command will:

That way all the constants not used outside will be made private safely.


6. Split huge Symfony config to per-package in directory

Do you have a huge Symfony config file that is hard to navigate? Do you want to split it to per-package files?

Before - one huge config/config_dev.php with many extensions in a single file:

Run the command:

After - the original config only imports the per-package files:

And each extension lives in its own file, e.g. config/packages/dev/doctrine.php:

All the extensions will be extracted to separate files in config/packages/dev directory, making them much more readable.


7. Generate Symfony Smoke Tests

Cover your Symfony app with smoke tests in seconds. This command scans your composer.json, picks the matching test templates, and drops them under tests/Unit/Smoke (or your project's equivalent unit-tests directory).

The command will:

Existing files are never overwritten, so the command is safe to re-run.

The generated ServiceContainerTest boots the kernel and asserts every service can be instantiated:


8. Detect Duplicated Code

Spot copy-pasted code blocks with a token-based detector, a small clone of phpcpd. Add it to CI to fail when a large copy-pasted block is added:

Options:

Exit code is 1 when clones are found, 0 otherwise.


10. Measure Code Size

Measure lines of code and structure size of your project - files, classes, methods, constants and more:

Options:


11. Count PHP Features

Count PHP features used in the project, grouped by the PHP version that introduced them. Handy to see how modern your code is before an upgrade:

Options:


12. Check for Outdated Dependencies in CI

Postponing upgrades leads to large, risky jumps. The breakpoint command catches outdated major packages early, right in your CI pipeline:

↓


If there are more than 5 major outdated packages, the CI will fail.

Options:


13. Open up Next Versions

We know we're behind, but where to start? Instead of guessing, let Composer handle it - open up package versions to the next nearest step:

This opens up 5 versions to their next step, e.g.:

Then run composer update - if no blockers exist, Composer updates packages to their next version.

Options:


14. Raise to Installed Versions

Sometimes it's the opposite - dependencies are new, but composer.json is outdated:

Here illuminate/container allows 12.0 but we already use 12.14, and symfony/finder allows 6.4 but we use 7.2. Running composer update could pull unnecessary older dependencies.

Raise composer.json to the installed versions:

Options:


That's it!


Happy coding!


All versions of swiss-knife with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
ext-tokenizer Version *
composer/semver Version ^3.5
entropy/entropy Version ^0.4.23
nikic/php-parser Version ^5.9
symfony/process Version ^5.4 || ^6.4 || ^7.0 || ^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 rector/swiss-knife contains the following files

Loading the files please wait ...