Skip to content

Commit

Permalink
Release 2.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
stelgenhof committed Jan 30, 2022
2 parents 1e751e2 + 2c34708 commit 5fd9981
Show file tree
Hide file tree
Showing 1,669 changed files with 14,172 additions and 8,069 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/coding-standard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
fail-fast: false
matrix:
operating-system: [ ubuntu-latest, windows-latest, macOS-latest ]
php-versions: [ '7.3', '7.4', '8.0' ]
php-versions: [ '7.4', '8.0' ]

steps:
- name: Set git to use LF
Expand Down Expand Up @@ -49,4 +49,4 @@ jobs:
run: composer install --no-progress --prefer-dist --optimize-autoloader

- name: Check Code Style
run: vendor/bin/php-cs-fixer --allow-risky=yes --diff --dry-run -v fix
run: vendor/bin/php-cs-fixer --diff --dry-run -v fix
4 changes: 2 additions & 2 deletions .github/workflows/mutation-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ jobs:
strategy:
fail-fast: false
matrix:
operating-system: [ ubuntu-latest, windows-latest, macOS-latest ]
php-versions: [ '7.3', '7.4', '8.0' ]
operating-system: [ ubuntu-latest ]
php-versions: [ '7.4', '8.0' ]

steps:
- name: Set git to use LF
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
fail-fast: false
matrix:
operating-system: [ ubuntu-latest, windows-latest, macOS-latest ]
php-versions: [ '7.3', '7.4', '8.0' ]
php-versions: [ '7.4', '8.0' ]

steps:
- name: Set git to use LF
Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:
run: composer install --no-progress --prefer-dist --optimize-autoloader

- name: Run static analysis - PHPStan
run: vendor/bin/phpstan --level=5 analyse src
run: composer phpstan

- name: Run static analysis - Psalm
run: vendor/bin/psalm
2 changes: 1 addition & 1 deletion .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
fail-fast: false
matrix:
operating-system: [ ubuntu-latest, windows-latest, macOS-latest ]
php-versions: [ '7.3', '7.4', '8.0' ]
php-versions: [ '7.4', '8.0' ]

steps:
- name: Set git to use LF
Expand Down
76 changes: 35 additions & 41 deletions .phan/config.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
<?php

declare(strict_types=1);

use Phan\Issue;

/**
* This configuration file was automatically generated by 'phan --init --init-level=3'
/*
* This configuration file was automatically generated by 'phan --init --init-level=1'
*
* TODOs (added by 'phan --init'):
*
* - Go through this file and verify that there are no missing/unnecessary files/directories.
* (E.g. this only includes direct composer dependencies - You may have to manually add indirect composer dependencies to 'directory_list')
* - Look at 'plugins' and add or remove plugins if appropriate (see https://github.com/phan/phan/tree/v4/.phan/plugins#plugins)
* - Look at 'plugins' and add or remove plugins if appropriate (see https://github.com/phan/phan/tree/v5/.phan/plugins#plugins)
* - Add global suppressions for pre-existing issues to suppress_issue_types (https://github.com/phan/phan/wiki/Tutorial-for-Analyzing-a-Large-Sloppy-Code-Base)
* - Consider setting up a baseline if there are a large number of pre-existing issues (see `phan --extended-help`)
*
Expand All @@ -18,7 +20,7 @@
* after this file is read.
*
* @see https://github.com/phan/phan/wiki/Phan-Config-Settings for all configurable options
* @see https://github.com/phan/phan/tree/v4/src/Phan/Config.php
* @see https://github.com/phan/phan/tree/v5/src/Phan/Config.php
*
* A Note About Paths
* ==================
Expand All @@ -35,21 +37,21 @@
* '-d' flag.
*/
return [

// The PHP version that the codebase will be checked for compatibility against.
// For best results, the PHP binary used to run Phan should have the same PHP version.
// (Phan relies on Reflection for some types, param counts,
// and checks for undefined classes/methods/functions)
//
// Supported values: `'5.6'`, `'7.0'`, `'7.1'`, `'7.2'`, `'7.3'`, `'7.4'`, `null`.
// Supported values: `'5.6'`, `'7.0'`, `'7.1'`, `'7.2'`, `'7.3'`, `'7.4'`,
// `'8.0'`, `'8.1'`, `null`.
// If this is set to `null`,
// then Phan assumes the PHP version which is closest to the minor version
// of the php executable used to execute Phan.
//
// Note that the **only** effect of choosing `'5.6'` is to infer that functions removed in php 7.0 exist.
// (See `backward_compatibility_checks` for additional options)
// Automatically inferred from composer.json requirement for "php" of ">=7.3"
'target_php_version' => '7.3',
// Automatically inferred from composer.json requirement for "php" of "^7.4 || ^8.0"
'target_php_version' => '7.4',

// If enabled, missing properties will be created when
// they are first seen. If false, we'll report an
Expand All @@ -67,12 +69,12 @@
//
// This is an incremental step in migrating away from `null_casts_as_any_type`.
// If `null_casts_as_any_type` is true, this has no effect.
'null_casts_as_array' => true,
'null_casts_as_array' => false,

// If enabled, allow any array-like type to be cast to null.
// This is an incremental step in migrating away from `null_casts_as_any_type`.
// If `null_casts_as_any_type` is true, this has no effect.
'array_casts_as_null' => true,
'array_casts_as_null' => false,

// If enabled, scalars (int, float, bool, string, null)
// are treated as if they can cast to each other.
Expand All @@ -83,7 +85,7 @@
// are treated as if they can cast to each other.
// E.g. `array<int,stdClass>` can cast to `array<string,stdClass>` and vice versa.
// Normally, a scalar type such as int could only cast to/from int and mixed.
'scalar_array_key_cast' => true,
'scalar_array_key_cast' => false,

// If this has entries, scalars (int, float, bool, string, null)
// are allowed to perform the casts listed.
Expand All @@ -98,36 +100,36 @@
// or if **any** type in an invoked expression is not a callable.
// Setting this to true will introduce numerous false positives
// (and reveal some bugs).
'strict_method_checking' => false,
'strict_method_checking' => true,

// If enabled, Phan will warn if **any** type of the object expression for a property access
// does not contain that property.
'strict_object_checking' => false,
'strict_object_checking' => true,

// If enabled, Phan will warn if **any** type in the argument's union type
// cannot be cast to a type in the parameter's expected union type.
// Setting this to true will introduce numerous false positives
// (and reveal some bugs).
'strict_param_checking' => false,
'strict_param_checking' => true,

// If enabled, Phan will warn if **any** type in a property assignment's union type
// cannot be cast to a type in the property's declared union type.
// Setting this to true will introduce numerous false positives
// (and reveal some bugs).
'strict_property_checking' => false,
'strict_property_checking' => true,

// If enabled, Phan will warn if **any** type in a returned value's union type
// cannot be cast to the declared return type.
// Setting this to true will introduce numerous false positives
// (and reveal some bugs).
'strict_return_checking' => false,
'strict_return_checking' => true,

// If true, seemingly undeclared variables in the global
// scope will be ignored.
//
// This is useful for projects with complicated cross-file
// globals that you have no hope of fixing.
'ignore_undeclared_variables_in_global_scope' => true,
'ignore_undeclared_variables_in_global_scope' => false,

// Set this to false to emit `PhanUndeclaredFunction` issues for internal functions that Phan has signatures for,
// but aren't available in the codebase, or from Reflection.
Expand All @@ -137,7 +139,7 @@
//
// Even when this is false, Phan will still infer return values and check parameters of internal functions
// if Phan has the signatures.
'ignore_undeclared_functions_with_known_signatures' => true,
'ignore_undeclared_functions_with_known_signatures' => false,

// Backwards Compatibility Checking. This is slow
// and expensive, but you should consider running
Expand All @@ -160,7 +162,7 @@
// If true, check to make sure the return type declared
// in the doc-block (if any) matches the return type
// declared in the method signature.
'check_docblock_signature_return_type_match' => false,
'check_docblock_signature_return_type_match' => true,

// This setting maps case-insensitive strings to union types.
//
Expand Down Expand Up @@ -198,20 +200,20 @@
// `dead_code_detection` will also enable unused variable detection.
//
// This has a few known false positives, e.g. for loops or branches.
'unused_variable_detection' => false,
'unused_variable_detection' => true,

// Set to true in order to attempt to detect redundant and impossible conditions.
//
// This has some false positives involving loops,
// variables set in branches of loops, and global variables.
'redundant_condition_detection' => false,
'redundant_condition_detection' => true,

// If enabled, Phan will act as though it's certain of real return types of a subset of internal functions,
// even if those return types aren't available in reflection (real types were taken from php 7.3 or 8.0-dev, depending on target_php_version).
//
// Note that with php 7 and earlier, php would return null or false for many internal functions if the argument types or counts were incorrect.
// As a result, enabling this setting with target_php_version 8.0 may result in false positives for `--redundant-condition-detection` when codebases also support php 7.x.
'assume_real_types_for_internal_functions' => false,
'assume_real_types_for_internal_functions' => true,

// If true, this runs a quick version of checks that takes less
// time at the cost of not running as thorough
Expand Down Expand Up @@ -321,13 +323,22 @@
//
// Plugins which are bundled with Phan can be added here by providing their name (e.g. `'AlwaysReturnPlugin'`)
//
// Documentation about available bundled plugins can be found [here](https://github.com/phan/phan/tree/v4/.phan/plugins).
// Documentation about available bundled plugins can be found [here](https://github.com/phan/phan/tree/v5/.phan/plugins).
//
// Alternately, you can pass in the full path to a PHP file with the plugin's implementation (e.g. `'vendor/phan/phan/.phan/plugins/AlwaysReturnPlugin.php'`)
'plugins' => [
'AlwaysReturnPlugin',
'DollarDollarPlugin',
'DuplicateArrayKeyPlugin',
'DuplicateExpressionPlugin',
'PregRegexCheckerPlugin',
'PrintfCheckerPlugin',
'SleepCheckerPlugin',
'UnreachableCodePlugin',
'UseReturnValuePlugin',
'EmptyStatementListPlugin',
'StrictComparisonPlugin',
'LoopVariableReusePlugin',
],

// A list of directories that should be parsed for class and
Expand All @@ -338,29 +349,12 @@
// Thus, both first-party and third-party code being used by
// your application should be included in this list.
'directory_list' => [
'src/Yasumi',
'vendor/friendsofphp/php-cs-fixer/src',
'vendor/infection/infection/src',
'vendor/mikey179/vfsstream/src/main/php',
'vendor/phan/phan/src/Phan',
'vendor/phpunit/phpunit/src',
'vendor/vimeo/psalm/src/Psalm',
'src',
],

// A list of individual files to include in analysis
// with a path relative to the root directory of the
// project.
'file_list' => [
'vendor/friendsofphp/php-cs-fixer/tests/Test/AbstractFixerTestCase.php',
'vendor/friendsofphp/php-cs-fixer/tests/Test/AbstractIntegrationCaseFactory.php',
'vendor/friendsofphp/php-cs-fixer/tests/Test/AbstractIntegrationTestCase.php',
'vendor/friendsofphp/php-cs-fixer/tests/Test/Assert/AssertTokensTrait.php',
'vendor/friendsofphp/php-cs-fixer/tests/Test/IntegrationCase.php',
'vendor/friendsofphp/php-cs-fixer/tests/Test/IntegrationCaseFactory.php',
'vendor/friendsofphp/php-cs-fixer/tests/Test/IntegrationCaseFactoryInterface.php',
'vendor/friendsofphp/php-cs-fixer/tests/Test/InternalIntegrationCaseFactory.php',
'vendor/friendsofphp/php-cs-fixer/tests/Test/IsIdenticalConstraint.php',
'vendor/friendsofphp/php-cs-fixer/tests/Test/TokensWithObservedTransformers.php',
'vendor/friendsofphp/php-cs-fixer/tests/TestCase.php',
],
];
16 changes: 6 additions & 10 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,28 @@
/**
* This file is part of the Yasumi package.
*
* Copyright (c) 2015 - 2021 AzuyaLabs
* Copyright (c) 2015 - 2022 AzuyaLabs
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @author Sacha Telgenhof <me@sachatelgenhof.com>
* @author Sacha Telgenhof <me at sachatelgenhof dot com>
*/
$finder = PhpCsFixer\Finder::create()->in(__DIR__);

$config = new PhpCsFixer\Config();
$config->setRiskyAllowed(true)->setRules([
'@PSR2' => true,
'@Symfony' => true,
'blank_line_after_opening_tag' => true,
'is_null' => true,
'modernize_types_casting' => true,
'self_accessor' => true,
'dir_constant' => true,
'ordered_class_elements' => true,
'ordered_imports' => ['sort_algorithm' => 'alpha'],
'no_unused_imports' => true,
'single_quote' => true,
'space_after_semicolon' => true,
'trailing_comma_in_multiline' => true,
'cast_spaces' => ['space' => 'single'],
'declare_strict_types' => true,
])->setLineEnding("\n")->setFinder($finder);
'no_superfluous_elseif' => true,
'combine_consecutive_issets' => true,
'combine_consecutive_unsets' => true,
])->setFinder($finder);

return $config;
Loading

0 comments on commit 5fd9981

Please sign in to comment.