Changelog update [#3101]

This commit is contained in:
Matias Griese
2020-12-10 21:46:57 +02:00
parent c5cdeaef07
commit 8f7dc43e1f
6 changed files with 161 additions and 984 deletions

View File

@@ -2,6 +2,7 @@
## mm/dd/2020 ## mm/dd/2020
1. [](#new) 1. [](#new)
* Update phpstan to version 0.12
* Auto-Escape enabled by default. Manually enable **Twig Compatibility** and disable **Auto-Escape** to use the old setting. * Auto-Escape enabled by default. Manually enable **Twig Compatibility** and disable **Auto-Escape** to use the old setting.
* Updated unit tests to use codeception 4.1 * Updated unit tests to use codeception 4.1
* Added support for setting `GRAV_ENVIRONMENT` by using environment variable or a constant * Added support for setting `GRAV_ENVIRONMENT` by using environment variable or a constant

View File

@@ -230,6 +230,7 @@ Grav 1.7 REQUIRES PHP 7.3.6
* **DEPRECATED** `FlexDirectory::update()` and `FlexDirectory::remove()` * **DEPRECATED** `FlexDirectory::update()` and `FlexDirectory::remove()`
* **BC BREAK** Moved all Flex type classes under `Grav\Common\Flex` * **BC BREAK** Moved all Flex type classes under `Grav\Common\Flex`
* **BC BREAK** `FlexStorageInterface::getStoragePath()` and `getMediaPath()` can now return null * **BC BREAK** `FlexStorageInterface::getStoragePath()` and `getMediaPath()` can now return null
* **BC BREAK** `FlexStorageIngerface::getMetaData()` now has second optional argument
* **BC BREAK** Flex objects no longer return temporary key if they do not have one; empty key is returned instead * **BC BREAK** Flex objects no longer return temporary key if they do not have one; empty key is returned instead
* **BC BREAK** Added reload argument to `FlexStorageInterface::getMetaData()` * **BC BREAK** Added reload argument to `FlexStorageInterface::getMetaData()`
* You can add `edit_list.html.twig` file to a form field in order to customize look in the listing view * You can add `edit_list.html.twig` file to a form field in order to customize look in the listing view

View File

@@ -62,8 +62,8 @@
}, },
"require-dev": { "require-dev": {
"codeception/codeception": "^4.1", "codeception/codeception": "^4.1",
"phpstan/phpstan": "^0.11", "phpstan/phpstan": "^0.12",
"phpstan/phpstan-deprecation-rules": "^0.11", "phpstan/phpstan-deprecation-rules": "^0.12",
"phpunit/php-code-coverage": "~9.2", "phpunit/php-code-coverage": "~9.2",
"fzaninotto/faker": "^1.9", "fzaninotto/faker": "^1.9",
"victorjonsson/markdowndocs": "dev-master", "victorjonsson/markdowndocs": "dev-master",
@@ -113,11 +113,9 @@
}, },
"scripts": { "scripts": {
"api-17": "vendor/bin/phpdoc-md generate system/src > user/pages/14.api/default.17.md", "api-17": "vendor/bin/phpdoc-md generate system/src > user/pages/14.api/default.17.md",
"api-16": "vendor/bin/phpdoc-md generate system/src > user/pages/14.api/default.16.md",
"api-15": "vendor/bin/phpdoc-md generate system/src > user/pages/14.api/default.md",
"post-create-project-cmd": "bin/grav install", "post-create-project-cmd": "bin/grav install",
"phpstan": "vendor/bin/phpstan analyse -l 3 -c ./tests/phpstan/phpstan.neon --memory-limit=400M system/src", "phpstan": "vendor/bin/phpstan analyse -l 3 -c ./tests/phpstan/phpstan.neon --memory-limit=480M system/src",
"phpstan-framework": "vendor/bin/phpstan analyse -l 7 -c ./tests/phpstan/phpstan.neon --memory-limit=256M system/src/Grav/Framework", "phpstan-framework": "vendor/bin/phpstan analyse -l 8 -c ./tests/phpstan/phpstan.neon --memory-limit=480M system/src/Grav/Framework system/src/Grav/Events system/src/Grav/Installer system/src/Grav/Common/Assets system/src/Grav/Common/Backup system/src/Grav/Common/Config system/src/Grav/Common/Data system/src/Grav/Common/Errors system/src/Grav/Common/File system/src/Grav/Common/Helpers system/src/Grav/Common/Language system/src/Grav/Common/Markdown system/src/Grav/Common/Form system/src/Grav/Common/User",
"phpstan-plugins": "vendor/bin/phpstan analyse -l 1 -c ./tests/phpstan/plugins.neon --memory-limit=400M user/plugins", "phpstan-plugins": "vendor/bin/phpstan analyse -l 1 -c ./tests/phpstan/plugins.neon --memory-limit=400M user/plugins",
"test": "vendor/bin/codecept run unit", "test": "vendor/bin/codecept run unit",
"test-windows": "vendor\\bin\\codecept run unit" "test-windows": "vendor\\bin\\codecept run unit"

1034
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,3 +1,4 @@
#phpVersion: 70100
includes: includes:
#- '../../vendor/phpstan/phpstan-strict-rules/rules.neon' #- '../../vendor/phpstan/phpstan-strict-rules/rules.neon'
- '../../vendor/phpstan/phpstan-deprecation-rules/rules.neon' - '../../vendor/phpstan/phpstan-deprecation-rules/rules.neon'
@@ -5,11 +6,17 @@ parameters:
fileExtensions: fileExtensions:
- php - php
- dist - dist
bootstrap: tests/phpstan/phpstan-bootstrap.php bootstrapFiles:
- phpstan-bootstrap.php
excludes_analyse: excludes_analyse:
- system/src/Grav/Common/Errors/Resources/layout.html.php - */system/src/Grav/Common/Errors/Resources/layout.html.php
inferPrivatePropertyTypeFromConstructor: true inferPrivatePropertyTypeFromConstructor: true
reportUnmatchedIgnoredErrors: false reportUnmatchedIgnoredErrors: false
# These checks are new in phpstan 0.12, ignore them for now.
checkMissingIterableValueType: false
checkGenericClassInNonGenericObjectType: false
universalObjectCratesClasses: universalObjectCratesClasses:
- Grav\Common\Config\Config - Grav\Common\Config\Config
- Grav\Common\Config\Languages - Grav\Common\Config\Languages
@@ -23,12 +30,19 @@ parameters:
dynamicConstantNames: dynamicConstantNames:
- GRAV_CLI - GRAV_CLI
ignoreErrors: ignoreErrors:
# New in phpstan 0.12, ignore them for now.
- '#Unsafe usage of new static\(\)#'
- '#Cannot instantiate interface Grav\\Framework\\#'
# TODO: phpstan bug #3875 (fixed, test if can be removed)
-
message: '#Unreachable statement - code above always terminates#'
path: '*/system/src/Grav/Common/Flex/Types/Pages/Storage/PageStorage.php'
# FIXME: Bugs that need to be fixed # FIXME: Bugs that need to be fixed
# FIXME: PHP 7.3 bug workaround # FIXME: PHP 7.3 bug workaround
- -
message: '#If condition is always false.#' message: '#If condition is always false.#'
path: 'system/src/Grav/Framework/Session/Session.php' path: '*/system/src/Grav/Framework/Session/Session.php'
# TODO: Errors that needs some more thinking (bad design?) # TODO: Errors that needs some more thinking (bad design?)
- '#Access to an undefined property RocketTheme\\Toolbox\\Event\\Event::#' - '#Access to an undefined property RocketTheme\\Toolbox\\Event\\Event::#'
@@ -39,72 +53,71 @@ parameters:
- '#Access to an undefined property Grav\\Common\\Media\\Interfaces\\MediaObjectInterface::#' - '#Access to an undefined property Grav\\Common\\Media\\Interfaces\\MediaObjectInterface::#'
- -
message: '#Cannot call method path\(\) on string#' message: '#Cannot call method path\(\) on string#'
path: 'system/src/Grav/Common/Page/Media.php' path: '*/system/src/Grav/Common/Page/Media.php'
- '"FlexCollectionInterface::filterBy\(\) invoked with 2 parameters"' - '"FlexCollectionInterface::filterBy\(\) invoked with 2 parameters"'
# TODO: system.twig.umask_fix will not work with Twig 2 anymore # TODO: system.twig.umask_fix will not work with Twig 2 anymore
- -
message: '#Call to deprecated method writeCacheFile\(\) of class Twig\\Environment#' message: '#Call to deprecated method writeCacheFile\(\) of class Twig\\Environment#'
path: 'system/src/Grav/Common/Twig/WriteCacheFileTrait.php' path: '*/system/src/Grav/Common/Twig/WriteCacheFileTrait.php'
# Needed: full coverage (probably with admin plugin...) then redesign constructor # Needed: full coverage (probably with admin plugin...) then redesign constructor
- -
message: '#Grav\\Common\\GPM\\Remote\\GravCore::__construct\(\) does not call parent constructor from Grav\\Common\\GPM\\Remote\\AbstractPackageCollection#' message: '#Grav\\Common\\GPM\\Remote\\GravCore::__construct\(\) does not call parent constructor from Grav\\Common\\GPM\\Remote\\AbstractPackageCollection#'
path: 'system/src/Grav/Common/GPM/Remote/GravCore.php' path: '*/system/src/Grav/Common/GPM/Remote/GravCore.php'
# PSR-16 Exception interfaces do not extend \Throwable # PSR-16 Exception interfaces do not extend \Throwable
- '#PHPDoc tag \@throws with type Psr\\SimpleCache\\(CacheException|InvalidArgumentException) is not subtype of Throwable#' - '#PHPDoc tag \@throws with type Psr\\SimpleCache\\(CacheException|InvalidArgumentException) is not subtype of Throwable#'
# Needed: psr-17 (http-factories) support (through decorator or further investigations)
-
message: '#Call to an undefined static method Grav\\Framework\\Psr7\\Stream::create\(\)#'
path: 'system/src/Grav/Framework/Form/FormFlashFile.php'
# Medium __call() methods # Medium __call() methods
- '#Call to an undefined method Grav\\Common\\Page\\Medium\\(\w*)Medium::#' - '#Call to an undefined method Grav\\Common\\Page\\Medium\\(\w*)Medium::#'
# These errors are about plugins (need to find a better solution) # These errors are about plugins (need to find a better solution)
- -
message: '#Call to static method sendEmail\(\) on an unknown class Grav\\Plugin\\Email\\Utils#' message: '#Call to static method sendEmail\(\) on an unknown class Grav\\Plugin\\Email\\Utils#'
path: 'system/src/Grav/Common/Scheduler/Job.php' path: '*/system/src/Grav/Common/Scheduler/Job.php'
- -
message: '#on an unknown class Grav\\Plugin\\Admin#' message: '#unknown class Grav\\Plugin\\Admin#'
path: 'system/src/Grav/Common/Page/Pages.php' path: '*/system/src/Grav/Common/Page/Pages.php'
- -
message: '#on an unknown class Grav\\Plugin\\Admin#' message: '#unknown class Grav\\Plugin\\Admin#'
path: 'system/src/Grav/Common/Flex/Pages/PageObject.php' path: '*/system/src/Grav/Common/Flex/Pages/PageObject.php'
- -
message: '#Call to method getFlash\(\) on an unknown class Grav\\Common\\Grav\\Plugin\\Form\\Forms#' message: '#unknown class Grav\\Common\\Grav\\Plugin\\Form\\Forms#'
path: 'system/src/Grav/Common/Session.php' path: '*/system/src/Grav/Common/Session.php'
- -
message: '#unknown class Grav\\Plugin\\Admin\\Admin#' message: '#unknown class Grav\\Plugin\\Admin\\Admin#'
path: 'system/src/Grav/Common/Flex/Types/Pages/PageObject.php' path: '*/system/src/Grav/Common/Flex/Types/Pages/PageObject.php'
# Can be ignored, after fopen there's always an $http_response_header locally available # Can be ignored, after fopen there's always an $http_response_header locally available
- -
message: '#Variable \$http_response_header in isset\(\) always exists and is not nullable#' message: '#Variable \$http_response_header in isset\(\) always exists and is not nullable#'
path: 'system/src/Grav/Common/GPM/Response.php' path: '*/system/src/Grav/Common/GPM/Response.php'
# Clockwork does not define functions for __call() call
-
message: '#Call to an undefined method Clockwork\\Clockwork::(info|userData|addEvent|alert)\(\)#'
path: '*/system/src/Grav/Common/Debugger.php'
# These errors can be ignored (they depend on installed extensions) # These errors can be ignored (they depend on installed extensions)
- -
message: '#Instantiated class (Memcache|Memcached|Redis|RedisException) not found#' message: '#Instantiated class (Memcache|Memcached|Redis|RedisException) not found#'
path: 'system/src/Grav/Common/Cache.php' path: '*/system/src/Grav/Common/Cache.php'
- -
message: '#unknown class (Memcache|Memcached|Redis|RedisException)#' message: '#unknown class (Memcache|Memcached|Redis|RedisException)#'
path: 'system/src/Grav/Common/Cache.php' path: '*/system/src/Grav/Common/Cache.php'
- -
message: '#unknown class Collator#' message: '#unknown class Collator#'
path: 'system/src/Grav/Common/Page/Pages.php' path: '*/system/src/Grav/Common/Page/Pages.php'
- -
message: '#unknown class Collator#' message: '#unknown class Collator#'
path: 'system/src/Grav/Common/Flex/Types/Pages/PageCollection.php' path: '*/system/src/Grav/Common/Flex/Types/Pages/PageCollection.php'
- -
message: '#Ternary operator condition is always true#' message: '#Ternary operator condition is always true#'
path: 'system/src/Grav/Framework/Cache/AbstractCache.php' path: '*/system/src/Grav/Framework/Cache/AbstractCache.php'
- -
message: '#Call to function is_object\(\) with int will always evaluate to false#' message: '#Call to function is_object\(\) with int will always evaluate to false#'
path: 'system/src/Grav/Framework/Cache/AbstractCache.php' path: '*/system/src/Grav/Framework/Cache/AbstractCache.php'
# XHprof # XHprof
- '#tideways_xhprof_enable#' - '#tideways_xhprof_enable#'
@@ -112,37 +125,39 @@ parameters:
# Support for deprecated features # Support for deprecated features
- -
message: '#Instantiation of deprecated class Doctrine\\Common\\Cache\\MemcacheCache#' message: '#Instantiation of deprecated class Doctrine\\Common\\Cache\\MemcacheCache#'
path: 'system/src/Grav/Common/Cache.php' path: '*/system/src/Grav/Common/Cache.php'
- -
message: '#Call to deprecated method order#' message: '#Call to deprecated method order#'
path: 'system/src/Grav/Common/Page/Pages.php' path: '*/system/src/Grav/Common/Page/Pages.php'
- -
message: '#Fetching class constant class of deprecated class Grav\\Common\\User\\User#' message: '#Fetching class constant class of deprecated class Grav\\Common\\User\\User#'
path: 'system/src/Grav/Common/Service/AccountsServiceProvider.php' path: '*/system/src/Grav/Common/Service/AccountsServiceProvider.php'
- -
message: '#Call to deprecated method getLegacyFiles\(\)#' message: '#Call to deprecated method getLegacyFiles\(\)#'
path: 'system/src/Grav/Common/Session.php' path: '*/system/src/Grav/Common/Session.php'
- -
message: '#Call to deprecated method getType\(\) of class#' message: '#Call to deprecated method getType\(\) of class#'
path: 'system/src/Grav/Framework/Object/Base/ObjectTrait.php' path: '*/system/src/Grav/Framework/Object/Base/ObjectTrait.php'
- -
message: '#Call to deprecated method \w+\(\) of class Grav\\Framework\\Flex\\FlexObject#' message: '#Call to deprecated method \w+\(\) of class Grav\\Framework\\Flex\\FlexObject#'
path: 'system/src/Grav/Framework/Flex/FlexObject.php' path: '*/system/src/Grav/Framework/Flex/FlexObject.php'
- -
message: '#Call to deprecated method \w+\(\) of class Grav\\Framework\\Flex\\FlexIndex#' message: '#Call to deprecated method \w+\(\) of class Grav\\Framework\\Flex\\FlexIndex#'
path: 'system/src/Grav/Framework/Flex/FlexIndex.php' path: '*/system/src/Grav/Framework/Flex/FlexIndex.php'
- -
message: '#Call to deprecated method \w+\(\) of class Grav\\Framework\\Flex\\FlexCollection#' message: '#Call to deprecated method \w+\(\) of class Grav\\Framework\\Flex\\FlexCollection#'
path: 'system/src/Grav/Framework/Flex/FlexCollection.php' path: '*/system/src/Grav/Framework/Flex/FlexCollection.php'
- -
message: '#Call to deprecated method (getAuthorizeScope|getActiveUser)\(\) of class Grav\\Framework\\Flex\\FlexObject#' message: '#Call to deprecated method (getAuthorizeScope|getActiveUser)\(\) of class Grav\\Framework\\Flex\\FlexObject#'
path: 'system/src/Grav/Framework/Flex/Pages/Traits/PageAuthorsTrait.php' path: '*/system/src/Grav/Framework/Flex/Pages/Traits/PageAuthorsTrait.php'
- -
message: '#deprecated class#' message: '#deprecated class#'
path: 'system/src/Grav/Framework/Uri/Uri.php' path: '*/system/src/Grav/Framework/Uri/Uri.php'
- -
message: '#Method Symfony\\Contracts\\EventDispatcher\\EventDispatcherInterface::dispatch#' message: '#Method Symfony\\Contracts\\EventDispatcher\\EventDispatcherInterface::dispatch#'
path: 'system/src/Grav/Common/Grav.php' path: '*/system/src/Grav/Common/Grav.php'
- '#has typehint with deprecated class RocketTheme\\Toolbox\\Event\\Event#'
- '#Call to deprecated method stopPropagation\(\) of class Symfony\\Component\\EventDispatcher\\Event#' - '#Call to deprecated method stopPropagation\(\) of class Symfony\\Component\\EventDispatcher\\Event#'
- '#Parameter \#2 \$listener of method Symfony\\Component\\EventDispatcher\\EventDispatcher::addListener\(\)#' - '#Parameter \#2 \$listener of method Symfony\\Component\\EventDispatcher\\EventDispatcher::addListener\(\)#'
- '#Parameter \#2 \$listener of method Symfony\\Component\\EventDispatcher\\EventDispatcher::removeListener\(\)#' - '#Parameter \#2 \$listener of method Symfony\\Component\\EventDispatcher\\EventDispatcher::removeListener\(\)#'

View File

@@ -9,8 +9,13 @@ parameters:
- %currentWorkingDirectory%/user/plugins/*/tests/* - %currentWorkingDirectory%/user/plugins/*/tests/*
- %currentWorkingDirectory%/user/plugins/gantry5/src/platforms - %currentWorkingDirectory%/user/plugins/gantry5/src/platforms
- %currentWorkingDirectory%/user/plugins/gantry5/src/classes/Gantry/Framework/Services/ErrorServiceProvider.php - %currentWorkingDirectory%/user/plugins/gantry5/src/classes/Gantry/Framework/Services/ErrorServiceProvider.php
bootstrap: tests/phpstan/plugins-bootstrap.php bootstrapFiles:
- plugins-bootstrap.php
reportUnmatchedIgnoredErrors: false reportUnmatchedIgnoredErrors: false
# These checks are new in phpstan 0.12, ignore them for now.
checkMissingIterableValueType: false
checkGenericClassInNonGenericObjectType: false
universalObjectCratesClasses: universalObjectCratesClasses:
- Grav\Common\Config\Config - Grav\Common\Config\Config
- Grav\Common\Config\Languages - Grav\Common\Config\Languages
@@ -41,3 +46,6 @@ parameters:
- '#Call to deprecated method (stopPropagation|isPropagationStopped)\(\) of class Symfony\\Component\\EventDispatcher\\Event#' - '#Call to deprecated method (stopPropagation|isPropagationStopped)\(\) of class Symfony\\Component\\EventDispatcher\\Event#'
- '#Call to an undefined method Grav\\Plugin\\ApartmentData\\Application\\Application::#' - '#Call to an undefined method Grav\\Plugin\\ApartmentData\\Application\\Application::#'
- '#Parameter \#1 \$lineNumberStyle of method ScssPhp\\ScssPhp\\Compiler::setLineNumberStyle\(\) expects string, int given#' - '#Parameter \#1 \$lineNumberStyle of method ScssPhp\\ScssPhp\\Compiler::setLineNumberStyle\(\) expects string, int given#'
# Deprecated event class
- '#has typehint with deprecated class RocketTheme\\Toolbox\\Event\\Event#'