summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-11-03 09:57:32 +0300
committerAndrew Dolgov <[email protected]>2021-11-03 09:57:32 +0300
commitca4e9d2a0845d4655f4677425e90c71d9eddbd40 (patch)
tree38ecabcaac903835a8be309b711cee6b635c1e5e
parent4363cad118cb7bb6bae49360d2767084a32a342d (diff)
require phpstan 1.0 with some related fixes
-rw-r--r--classes/config.php9
-rw-r--r--composer.json3
-rw-r--r--composer.lock67
-rw-r--r--vendor/composer/ClassLoader.php40
-rw-r--r--vendor/composer/LICENSE2
-rw-r--r--vendor/composer/autoload_classmap.php1
-rw-r--r--vendor/composer/autoload_real.php24
-rw-r--r--vendor/composer/autoload_static.php5
-rw-r--r--vendor/composer/installed.json197
9 files changed, 225 insertions, 123 deletions
diff --git a/classes/config.php b/classes/config.php
index e62ea34..3485081 100644
--- a/classes/config.php
+++ b/classes/config.php
@@ -29,10 +29,9 @@ class Config {
private static $instance;
private $params = [];
- private $schema_version = null;
private $version = [];
- /** @var Db_Migrations $migrations */
+ /** @var Db_Migrations|null $migrations */
private $migrations;
public static function get_instance() : Config {
@@ -50,10 +49,10 @@ class Config {
$ref = new ReflectionClass(get_class($this));
foreach ($ref->getConstants() as $const => $cvalue) {
- if (isset($this::_DEFAULTS[$const])) {
- $override = getenv($this::_ENVVAR_PREFIX . $const);
+ if (isset(self::_DEFAULTS[$const])) {
+ $override = getenv(self::_ENVVAR_PREFIX . $const);
- list ($defval, $deftype) = $this::_DEFAULTS[$const];
+ list ($defval, $deftype) = self::_DEFAULTS[$const];
$this->params[$cvalue] = [ self::cast_to(!empty($override) ? $override : $defval, $deftype), $deftype ];
}
diff --git a/composer.json b/composer.json
index f9759d5..6f1f54b 100644
--- a/composer.json
+++ b/composer.json
@@ -1,5 +1,8 @@
{
"require": {
"j4mie/idiorm": "^1.5"
+ },
+ "require-dev": {
+ "phpstan/phpstan": "^1.0"
}
}
diff --git a/composer.lock b/composer.lock
index 9a8c1d0..dcf0596 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "40874589866abd68fbda2924125357d3",
+ "content-hash": "6f69c4e02ff9198ff0f4834cbdaaa806",
"packages": [
{
"name": "j4mie/idiorm",
@@ -73,7 +73,68 @@
"time": "2020-04-29T00:37:09+00:00"
}
],
- "packages-dev": [],
+ "packages-dev": [
+ {
+ "name": "phpstan/phpstan",
+ "version": "1.0.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/phpstan/phpstan.git",
+ "reference": "0eb6ecdfbcebf2207668087dfb2e215581a75023"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/phpstan/phpstan/zipball/0eb6ecdfbcebf2207668087dfb2e215581a75023",
+ "reference": "0eb6ecdfbcebf2207668087dfb2e215581a75023",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.1|^8.0"
+ },
+ "conflict": {
+ "phpstan/phpstan-shim": "*"
+ },
+ "bin": [
+ "phpstan",
+ "phpstan.phar"
+ ],
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0-dev"
+ }
+ },
+ "autoload": {
+ "files": [
+ "bootstrap.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "description": "PHPStan - PHP Static Analysis Tool",
+ "funding": [
+ {
+ "url": "https://github.com/ondrejmirtes",
+ "type": "github"
+ },
+ {
+ "url": "https://github.com/phpstan",
+ "type": "github"
+ },
+ {
+ "url": "https://www.patreon.com/phpstan",
+ "type": "patreon"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2021-11-02T10:25:31+00:00"
+ }
+ ],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
@@ -81,5 +142,5 @@
"prefer-lowest": false,
"platform": [],
"platform-dev": [],
- "plugin-api-version": "2.0.0"
+ "plugin-api-version": "1.1.0"
}
diff --git a/vendor/composer/ClassLoader.php b/vendor/composer/ClassLoader.php
index 247294d..fce8549 100644
--- a/vendor/composer/ClassLoader.php
+++ b/vendor/composer/ClassLoader.php
@@ -37,13 +37,11 @@ namespace Composer\Autoload;
*
* @author Fabien Potencier <[email protected]>
* @author Jordi Boggiano <[email protected]>
- * @see https://www.php-fig.org/psr/psr-0/
- * @see https://www.php-fig.org/psr/psr-4/
+ * @see http://www.php-fig.org/psr/psr-0/
+ * @see http://www.php-fig.org/psr/psr-4/
*/
class ClassLoader
{
- private $vendorDir;
-
// PSR-4
private $prefixLengthsPsr4 = array();
private $prefixDirsPsr4 = array();
@@ -59,17 +57,10 @@ class ClassLoader
private $missingClasses = array();
private $apcuPrefix;
- private static $registeredLoaders = array();
-
- public function __construct($vendorDir = null)
- {
- $this->vendorDir = $vendorDir;
- }
-
public function getPrefixes()
{
if (!empty($this->prefixesPsr0)) {
- return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
+ return call_user_func_array('array_merge', $this->prefixesPsr0);
}
return array();
@@ -309,17 +300,6 @@ class ClassLoader
public function register($prepend = false)
{
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
-
- if (null === $this->vendorDir) {
- return;
- }
-
- if ($prepend) {
- self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
- } else {
- unset(self::$registeredLoaders[$this->vendorDir]);
- self::$registeredLoaders[$this->vendorDir] = $this;
- }
}
/**
@@ -328,10 +308,6 @@ class ClassLoader
public function unregister()
{
spl_autoload_unregister(array($this, 'loadClass'));
-
- if (null !== $this->vendorDir) {
- unset(self::$registeredLoaders[$this->vendorDir]);
- }
}
/**
@@ -391,16 +367,6 @@ class ClassLoader
return $file;
}
- /**
- * Returns the currently registered loaders indexed by their corresponding vendor directories.
- *
- * @return self[]
- */
- public static function getRegisteredLoaders()
- {
- return self::$registeredLoaders;
- }
-
private function findFileWithExtension($class, $ext)
{
// PSR-4 lookup
diff --git a/vendor/composer/LICENSE b/vendor/composer/LICENSE
index f27399a..62ecfd8 100644
--- a/vendor/composer/LICENSE
+++ b/vendor/composer/LICENSE
@@ -1,4 +1,3 @@
-
Copyright (c) Nils Adermann, Jordi Boggiano
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -18,4 +17,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-
diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php
index 429869e..8bbdabd 100644
--- a/vendor/composer/autoload_classmap.php
+++ b/vendor/composer/autoload_classmap.php
@@ -6,7 +6,6 @@ $vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
- 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
'IdiormMethodMissingException' => $vendorDir . '/j4mie/idiorm/idiorm.php',
'IdiormResultSet' => $vendorDir . '/j4mie/idiorm/idiorm.php',
'IdiormString' => $vendorDir . '/j4mie/idiorm/idiorm.php',
diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php
index 021aa89..e04f98c 100644
--- a/vendor/composer/autoload_real.php
+++ b/vendor/composer/autoload_real.php
@@ -22,15 +22,13 @@ class ComposerAutoloaderInit22dd97f3535dc47d76a59cd97b7f2699
return self::$loader;
}
- require __DIR__ . '/platform_check.php';
-
spl_autoload_register(array('ComposerAutoloaderInit22dd97f3535dc47d76a59cd97b7f2699', 'loadClassLoader'), true, true);
- self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
+ self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInit22dd97f3535dc47d76a59cd97b7f2699', 'loadClassLoader'));
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) {
- require __DIR__ . '/autoload_static.php';
+ require_once __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit22dd97f3535dc47d76a59cd97b7f2699::getInitializer($loader));
} else {
@@ -52,6 +50,24 @@ class ComposerAutoloaderInit22dd97f3535dc47d76a59cd97b7f2699
$loader->register(true);
+ if ($useStaticLoader) {
+ $includeFiles = Composer\Autoload\ComposerStaticInit22dd97f3535dc47d76a59cd97b7f2699::$files;
+ } else {
+ $includeFiles = require __DIR__ . '/autoload_files.php';
+ }
+ foreach ($includeFiles as $fileIdentifier => $file) {
+ composerRequire22dd97f3535dc47d76a59cd97b7f2699($fileIdentifier, $file);
+ }
+
return $loader;
}
}
+
+function composerRequire22dd97f3535dc47d76a59cd97b7f2699($fileIdentifier, $file)
+{
+ if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
+ require $file;
+
+ $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
+ }
+}
diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php
index 77aa695..c4c2a7d 100644
--- a/vendor/composer/autoload_static.php
+++ b/vendor/composer/autoload_static.php
@@ -6,8 +6,11 @@ namespace Composer\Autoload;
class ComposerStaticInit22dd97f3535dc47d76a59cd97b7f2699
{
+ public static $files = array (
+ '9b38cf48e83f5d8f60375221cd213eee' => __DIR__ . '/..' . '/phpstan/phpstan/bootstrap.php',
+ );
+
public static $classMap = array (
- 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
'IdiormMethodMissingException' => __DIR__ . '/..' . '/j4mie/idiorm/idiorm.php',
'IdiormResultSet' => __DIR__ . '/..' . '/j4mie/idiorm/idiorm.php',
'IdiormString' => __DIR__ . '/..' . '/j4mie/idiorm/idiorm.php',
diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json
index 0e5348d..e93490c 100644
--- a/vendor/composer/installed.json
+++ b/vendor/composer/installed.json
@@ -1,75 +1,132 @@
-{
- "packages": [
- {
- "name": "j4mie/idiorm",
- "version": "v1.5.7",
- "version_normalized": "1.5.7.0",
- "source": {
- "type": "git",
- "url": "https://github.com/j4mie/idiorm.git",
- "reference": "d23f97053ef5d0b988a02c6a71eb5c6118b2f5b4"
+[
+ {
+ "name": "j4mie/idiorm",
+ "version": "v1.5.7",
+ "version_normalized": "1.5.7.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/j4mie/idiorm.git",
+ "reference": "d23f97053ef5d0b988a02c6a71eb5c6118b2f5b4"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/j4mie/idiorm/zipball/d23f97053ef5d0b988a02c6a71eb5c6118b2f5b4",
+ "reference": "d23f97053ef5d0b988a02c6a71eb5c6118b2f5b4",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.2.0"
+ },
+ "require-dev": {
+ "ext-pdo_sqlite": "*",
+ "phpunit/phpunit": "^4.8"
+ },
+ "time": "2020-04-29T00:37:09+00:00",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "classmap": [
+ "idiorm.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-2-Clause",
+ "BSD-3-Clause",
+ "BSD-4-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Jamie Matthews",
+ "email": "[email protected]",
+ "homepage": "http://j4mie.org",
+ "role": "Developer"
},
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/j4mie/idiorm/zipball/d23f97053ef5d0b988a02c6a71eb5c6118b2f5b4",
- "reference": "d23f97053ef5d0b988a02c6a71eb5c6118b2f5b4",
- "shasum": ""
+ {
+ "name": "Simon Holywell",
+ "email": "[email protected]",
+ "homepage": "http://simonholywell.com",
+ "role": "Maintainer"
},
- "require": {
- "php": ">=5.2.0"
- },
- "require-dev": {
- "ext-pdo_sqlite": "*",
- "phpunit/phpunit": "^4.8"
+ {
+ "name": "Durham Hale",
+ "email": "[email protected]",
+ "homepage": "http://durhamhale.com",
+ "role": "Maintainer"
+ }
+ ],
+ "description": "A lightweight nearly-zero-configuration object-relational mapper and fluent query builder for PHP5",
+ "homepage": "http://j4mie.github.com/idiormandparis",
+ "keywords": [
+ "idiorm",
+ "orm",
+ "query builder"
+ ],
+ "support": {
+ "issues": "https://github.com/j4mie/idiorm/issues",
+ "source": "https://github.com/j4mie/idiorm"
+ }
+ },
+ {
+ "name": "phpstan/phpstan",
+ "version": "1.0.1",
+ "version_normalized": "1.0.1.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/phpstan/phpstan.git",
+ "reference": "0eb6ecdfbcebf2207668087dfb2e215581a75023"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/phpstan/phpstan/zipball/0eb6ecdfbcebf2207668087dfb2e215581a75023",
+ "reference": "0eb6ecdfbcebf2207668087dfb2e215581a75023",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.1|^8.0"
+ },
+ "conflict": {
+ "phpstan/phpstan-shim": "*"
+ },
+ "time": "2021-11-02T10:25:31+00:00",
+ "bin": [
+ "phpstan",
+ "phpstan.phar"
+ ],
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0-dev"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "files": [
+ "bootstrap.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "description": "PHPStan - PHP Static Analysis Tool",
+ "funding": [
+ {
+ "url": "https://github.com/ondrejmirtes",
+ "type": "github"
},
- "time": "2020-04-29T00:37:09+00:00",
- "type": "library",
- "installation-source": "dist",
- "autoload": {
- "classmap": [
- "idiorm.php"
- ]
+ {
+ "url": "https://github.com/phpstan",
+ "type": "github"
},
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-2-Clause",
- "BSD-3-Clause",
- "BSD-4-Clause"
- ],
- "authors": [
- {
- "name": "Jamie Matthews",
- "email": "[email protected]",
- "homepage": "http://j4mie.org",
- "role": "Developer"
- },
- {
- "name": "Simon Holywell",
- "email": "[email protected]",
- "homepage": "http://simonholywell.com",
- "role": "Maintainer"
- },
- {
- "name": "Durham Hale",
- "email": "[email protected]",
- "homepage": "http://durhamhale.com",
- "role": "Maintainer"
- }
- ],
- "description": "A lightweight nearly-zero-configuration object-relational mapper and fluent query builder for PHP5",
- "homepage": "http://j4mie.github.com/idiormandparis",
- "keywords": [
- "idiorm",
- "orm",
- "query builder"
- ],
- "support": {
- "issues": "https://github.com/j4mie/idiorm/issues",
- "source": "https://github.com/j4mie/idiorm"
+ {
+ "url": "https://www.patreon.com/phpstan",
+ "type": "patreon"
},
- "install-path": "../j4mie/idiorm"
- }
- ],
- "dev": true,
- "dev-package-names": []
-}
+ {
+ "url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan",
+ "type": "tidelift"
+ }
+ ]
+ }
+]