Download the PHP package cambis/silverstan without Composer

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

Silverstan | Kaitiaki Ponga

PHPStan extensions and rules for Silverstripe CMS.

Features ✨

Here are some of the nice features this extension provides:

Prerequisites 🦺

Why Silverstripe 5.2?

Silverstripe 5.2 introduces generic typehints. These changes allow the module to infer the types of objects without relying on an extension.

To make the best use of this module, make sure that your classes are correctly annotated using a combination of generics, and property/method annotations.

Installation 👷‍♀️

Install via composer.

If you also install phpstan/extension-installer then you're all set!

Manual installation If you don't want to use `phpstan/extension-installer`, include extension.neon in your project's PHPStan config:

Rules 🚨

Silverstan provides a set of customisable rules that can help make your application safer.

Each rule can be enabled/disabled individually using the configuration options, please refer to the rules overview for the available options.

SilverStripe\Dev\TestOnly 👨‍🔬

Complex analysis of SilverStripe\Dev\TestOnly classes is disabled by default. This is because these classes often contain dependencies that aren't provided by Silverstripe.

To enable complex analysis of these classes, please check the following option in your configuration file:

If PHPStan complains about missing classes, be sure to add the corresponding package to your dev dependencies.

SilverStripe\Core\Extensible 🧑‍🔬

Solving magic methods and properties

Silverstan provides support for magic SilverStripe\Core\Extensible methods and properties.

Silverstan will attempt to resolve magic methods/properties by searching for existing annotations in the class ancestry first. If no annotation is found it will access the configuration API in order to resolve the magic method/property.

Using annotations is preferred, as they can often provide more information, have stricter types, and reduce the number of calls to the configuration API.

You can use Silverstripe Rector to create the annotations for you.

Solving SilverStripe\Core\Extensible::hasExtension() and SilverStripe\Core\Extensible::hasMethod()

Silverstan provides type specifying extensions for these cases. However, these extensions can only be applied on a per class basis.

The default configuration applies these extensions to SilverStripe\View\ViewableData only. If you wish to add them to other SilverStripe\Core\Extensible classes that aren't subclasses of the former you can use the following configuration:

Solving SilverStripe\Core\Extensible::has_extension()

[!WARNING] Silverstan does not support type specification for SilverStripe\Core\Extensible::has_extension(). If you use this method in your codebase, consider using one of the following examples to help solve errors that may be reported by PHPStan.

In the example below, we are adding a typehint to inform PHPStan of the expected type.

In the example below, we are changing the calls to use the dynamic SilverStripe\Core\Extensible::hasExtension() method which is supported by Silverstan.

SilverStripe\Core\Config\Config_ForClass 👩‍🔬

[!WARNING] Silverstan cannot resolve the type of a property fetch on SilverStripe\Core\Config\Config_ForClass, use SilverStripe\Core\Config\Config_ForClass::get() instead. See the rules overview.


All versions of silverstan with dependencies

PHP Build Version
Package Version
Requires phpstan/phpstan Version ^1.12
silverstripe/config Version ^2.0
silverstripe/framework Version ^5.2
symplify/rule-doc-generator-contracts Version ^11.1
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 cambis/silverstan contains the following files

Loading the files please wait ....