Download the PHP package forrest79/phpgsql-phpstan without Composer

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

PhPgSql class reflection extension for PHPStan

Build

Introduction

This extension defines dynamic methods and other PHPStan setting for Forrest79\PhPgSql.

Installation

To use this extension, require it in Composer:

Using

Include extension.neon in your project's PHPStan config:

If you're using your own Forrest79\PhPgSql\Db\Row or Forrest79\PhPgSql\Fluen\Query, you can set it likes this:

Or you can set just one extension:

You can also use simple Row type narrowing function is_dbrow($row[, $expectedProperties]). It returns bool but it's recommended to use this always only with the assert() function. This package will be probably missing in your production vendor so is_dbrow function will be missing too and a PHP script will crash on this. With correct production settings for the assert() function is calling is_dbrow() omitted and your production code will be correct.

In PHP this function only checks if $row is instance of Forrest79\PhPgSql\Db\Row and if you specify $expectedProperties (keys are column names and values are PHP types as string) it will check, if row has defined exactly expected columns (in PHP there is no types check, it's only for PHPStan).

The real magic is hidden in PHPStan extension. This function will narrow $row type as Forrest79\PhPgSql\Db\Row or your custom row object. And if you specify also properties, this will be correctly typed for PHPStan - originally all properties are mixed.

To set only this extension use:

Or you can use simple DbRow annotation.

Use DbRow pseudo-type whenever you want, params, returns, vars...

To set only this extension use:


All versions of phpgsql-phpstan with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
phpstan/phpstan Version ^2.0
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 forrest79/phpgsql-phpstan contains the following files

Loading the files please wait ....