A static analysis tool for finding errors in PHP applications

Overview

Psalm

Packagist Packagist Coverage Status Psalm coverage Psalm level

Psalm is a static analysis tool for finding errors in PHP applications.

Installation

To get started, check out the installation guide.

Live Demo

You can play around with Psalm on its website.

Documentation

Documentation is available on Psalm’s website, generated from the docs folder.

Interested in contributing?

Have a look at CONTRIBUTING.md.

Who made this

Built by Matt Brown (@muglug).

Maintained by Matt and Bruce Weirdan (@weirdan).

The engineering team at Vimeo have provided a lot encouragement, especially @nbeliard, @erunion and @nickyr.

Comments
  • Autoloading false-positives

    Autoloading false-positives

    I'm just beginning use of psalm on my project and am running into auto-loading issues (MissingDependency, UndefinedFunction, UndefinedClass). The relevant classes/functions are auto-loaded with composer.

    I installed psalm via composer, initialized, and ran.

    Here is my xml config, which is a straight generated one, except for a modified projectFiles section. Can you help?

    <?xml version="1.0"?>
    <psalm
    	totallyTyped="false"
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xmlns="https://getpsalm.org/schema/config"
    	xsi:schemaLocation="https://getpsalm.org/schema/config file://C:\wamp\www\main2\vendors\vimeo\psalm\config.xsd"
    >
    	<projectFiles>
    		<directory name="app" />
    		<directory name="ci" />
    		<directory name="config" />
    		<directory name="database" />
    		<directory name="linter" />
    		<directory name="tests" />
    		<ignoreFiles>
    			<file name="app/Console/cake.php" />
    			<directory name="app/Plugin/Alertify" />
    			<directory name="app/Plugin/DebugKit" />
    			<directory name="app/Plugin/Migrations" />
    			<directory name="app/Plugin/WhoopsCakephp" />
    			<directory name="app/Vendor/_additions/Sears" />
    			<directory name="app/Vendor/_additions/Zendesk" />
    			<directory name="app/Vendor/_additions/fzaninotto" />
    			<directory name="app/Vendor/_additions/league" />
    			<file name="app/Vendor/_additions/sphinxapi.php" />
    			<directory name="app/Vendor/_overrides" />
    			<directory name="app/webroot" />
    			<directory name="tests/_support/_generated" />
    			<file name="tests/acceptance/AcceptanceTester.php" />
    			<file name="tests/functional/FunctionalTester.php" />
    			<file name="tests/unit/UnitTester.php" />
    			<directory name="vendors" />
    		</ignoreFiles>
    	</projectFiles>
    
    	<issueHandlers>
    		<LessSpecificReturnType errorLevel="info" />
    
    		<!-- level 3 issues - slightly lazy code writing, but provably low false-negatives -->
    
    		<DeprecatedMethod errorLevel="info" />
    		<DeprecatedProperty errorLevel="info" />
    		<DeprecatedClass errorLevel="info" />
    		<DeprecatedConstant errorLevel="info" />
    		<DeprecatedInterface errorLevel="info" />
    		<DeprecatedTrait errorLevel="info" />
    
    		<InternalMethod errorLevel="info" />
    		<InternalProperty errorLevel="info" />
    		<InternalClass errorLevel="info" />
    
    		<MissingClosureReturnType errorLevel="info" />
    		<MissingReturnType errorLevel="info" />
    		<MissingPropertyType errorLevel="info" />
    		<InvalidDocblock errorLevel="info" />
    		<MisplacedRequiredParam errorLevel="info" />
    
    		<PropertyNotSetInConstructor errorLevel="info" />
    		<MissingConstructor errorLevel="info" />
    		<MissingClosureParamType errorLevel="info" />
    		<MissingParamType errorLevel="info" />
    
    		<RedundantCondition errorLevel="info" />
    
    		<DocblockTypeContradiction errorLevel="info" />
    		<RedundantConditionGivenDocblockType errorLevel="info" />
    
    		<UnresolvableInclude errorLevel="info" />
    
    		<RawObjectIteration errorLevel="info" />
    
    		<InvalidStringClass errorLevel="info" />
    	</issueHandlers>
    </psalm>
    
    bug 
    opened by josephzidell 58
  • Required package

    Required package "nikic/php-parser" is not installed

    It throws following error on running command "vendor/bin/psalm --init"

    Required package "nikic/php-parser" is not installed: cannot detect its version in [..]/vendor/muglug/package-versions-56/src/PackageVersions/Versions.php on line 281

    I tried on dev-master and 3.2.11 versions.

    opened by loic425 43
  • New annotation: psalm-self, as a pre-condition for the type of self when calling a method

    New annotation: psalm-self, as a pre-condition for the type of self when calling a method

    Use-case: A type-safe query builder:

    <?php
        
    class Query
    {   
        /**
         * @var string|null 
         */
        public $from;
            
        /**
         * @param string|null $from
         */
        public function __construct($from = null)
        {
            $this->from = $from;
        }
      
        /**
         * @param string $from
         * @return void
         * @psalm-self-out Query<string>
         */
        public function set($from)
        {
            $this->from = $from;
        }
      
        /**
         * @psalm-self Query<string>
         * @return string
         */
        public function execute()
        {
            return 'result';
        }
    }
    
    $q = new Query();
    $q->execute();  // Should show error
    $q->set('tablename');
    $q->execute();  // OK
    

    Another alternative would be using $this together with param: @param Query<string> $this.

    Thoughts? Using @psalm-self-out to change interface of $this will not work, because there will be multiple fields in the query object (both "select" and "from" need to be set at least to be a valid query, and this cannot easily be controlled by switching interface of "self" back and forth).

    Related discussion: https://github.com/vimeo/psalm/issues/3207#issuecomment-650061673

    Can make a PR if accepted.

    enhancement 
    opened by olleharstedt 41
  • Syntax for callable param/return types

    Syntax for callable param/return types

    Edit: consensus has coalesced around the callable(type1, type2): returntype syntax

    If we want to specify that a function receives a certain sort of closure, we should be able to use a type.

    e.g.

    /**
     * @param Closure<string, int, int> $foo
     */
    function takeClosure(Closure $foo) {
      $a = $foo(3, 5);
    }
    
    // this is good
    takeClosure(function(int $a, int $b) { return (string) ($a + $b); });
    // this fails
    takeClosure(function(int $a, string $b) { return (string) ($a + $b); });
    
    enhancement 
    opened by muglug 41
  • psalm is super slow - takes minutes before actually starting scanning a single file

    psalm is super slow - takes minutes before actually starting scanning a single file

    hi there,

    as already explained here, psalm takes minutes before even starting scanning the files. I don´t really understand what's going on, but I am not able to use it. because phpstorm has a timeout of 60 seconds, I will never be able to use psalm there 😕

    my project has 100k lines of code (vendor excluded: 1,3 million LOC).

    for testing, I was calling psalm within windows, files are located on the win filesystem as well, I wanted to be sure that is has nothing to do with samba, NFS, or any kind of folder sharing:

    php-7.4.13-Win32-vc15-x64\php.exe vendor\vimeo\psalm\psalm --diff --threads=50 -c psalm.xml --no-cache --debug --output-format=phpstorm --show-info=true mode\Mode_order.php

    scanning a single file takes:

    with --no-cache: 3 minutes before psalm says "scanning files" with cache: 2 minutes

    the actual scanning process of a single file takes 28,7 seconds:

    Checks took 28.76 seconds and used 264.131MB of memory
    Psalm was able to infer types for 82.7434% of the codebase
    

    here's my config:

    <?xml version="1.0"?>
    <psalm
        errorLevel="8"
        resolveFromConfigFile="true"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns="https://getpsalm.org/schema/config"
        xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
        cacheDirectory="cache"
    >
        <projectFiles>
            <directory name="." />
            <ignoreFiles>
                <directory name="vendor" />
                <directory name="/vendor" />
                <directory name="./vendor" />
            </ignoreFiles>
        </projectFiles>
    </psalm>
    

    the vendor here is only for testing because i wanted to be 100% sure, that it gets excluded. the fact is, the debug output shows me, that "Parsing" and "Scanning" also happens inside the vendor folder, i don´t know if that should happen or not.

    as mentioned here, I can see that ALL files are scanned, even the files in vendor. on the one hand, I do understand, that it´s necessary to know other files to be able to say what´s wrong or not, but if every scan, even with --diff and cache takes 2 minutes before the real scanning of a single files starts, psalm wouldn´t be usable for me and my project, which is sad. I don´t know this takes so long because of the project (too many files) or if something else is wrong here.

    I hope, someone can help me to find out.

    thanks, micha

    opened by michabbb 39
  • Appveyor config

    Appveyor config

    so a few things:

    1. ~Only the March 23rd commit 6235a5e is needed (probably) at present.~
    2. ~The last 3 a4e1310 7e47f8e and 508297b were only added because of my misunderstanding the composer error output on the first build; psalm/plugin-phpunit refuses to install because it's not currently on dev-master. 508267b features a workaround, I'm hoping there's a better workaround should it actually become an issue in future~
    3. ~I am insufficiently familiar with appveyor to determine what'll happen with regards to pull requests (i.e. how travis etc. can run tests on pull requests).~
    4. ~Running the tests on appveyor highlights the recurring windows-specific path issues described in #667, #1292, #1404, and #1467 - it does not fix them; that is to come later as described in #1467 re: "seeing what happens if everything is switched to unix paths"~ seemingly resolved in 877345a, hoping this doesn't break anything.

    @muglug @weirdan if you both can take a look at your convenience at the config and the build output to see if we're missing anything useful before I start the experiment with switching to all unix paths?

    opened by SignpostMarv 39
  • feat: make key-of/value-of usable with non-const arrays

    feat: make key-of/value-of usable with non-const arrays

    Currently key-of<T> and value-of<T> helper-types are only usable with class constants. But they can be even more powerful! This PR tries to add the following capabilites:

    1. Usage with array-like types (includes keyed array, and lists), even with literals
    /**
     * @return key-of<list<string>>
     */
    /**
     * @return key-of<array{a: string, b: string)>
     */
    
    1. Support for unions as T-param
    /**
     * @return key-of<array<int, string>|array<float, string>>
     */
    
    1. Improve template support of key-of, so that correctly not only array-key is checked, but instead only methods like array_keys can be used to ensure template support.
    /**
     * @template T of array
     * @param T $array
     * @return key-of<T>[]
     */
    function getKeys($array) {
        return array_keys($array);
    }
    
    1. Add template support to value-of which accepts array_values if used correctly.
    /**
     * @template T of array
     * @param T $array
     * @return value-of<T>[]
     */
    function getValues($array) {
        return array_values($array);
    }
    

    Unfortunately @psalm-assert-if-true seems to not support template types, and even if I fix a bug inside FunctionLikeDocblockScanner where template types aren't passed I have no success. So I welcome any suggestions to this! I saw that there is made use of assertions for array-key-exists but I didn't find how I can change the type of $key so that this test won't fail:

    /**
     * @template T of array
     * @param T $array
     * @return key-of<T>|null
     */
    function getKey(string $key, $array) {
        if (array_key_exists($key, $array)) {
            return $key;
         }
         return null;
    }
    
    release:feature PR: Need work 
    opened by Patrick-Remy 37
  • storage issues

    storage issues

    I had weird errors at work. I tried to run Psalm against almost all the project for the first time and I had this error:

    Exception
    Uncaught UnexpectedValueException: Expecting c:\users\Username\documents\phpstormprojects\project_name\req\v0.0.0\_global\objets\internes\customer_name.class.php:4544:237529:-:closure to have storage in C:\Users\Username\Documents\PhpstormProjects\project_name\req\v0.0.0\_GLOBAL\objets\internes\customer_name.class.php in C:\Users\Username\Documents\PhpstormProjects\project_name\vendor\vimeo\psalm\src\Psalm\Codebase.php:642
    Stack trace:
    #0 C:\Users\Username\Documents\PhpstormProjects\project_name\vendor\vimeo\psalm\src\Psalm\Internal\Analyzer\ClosureAnalyzer.php(24): Psalm\Codebase->getClosureStorage('C:\\Users\\Username...', 'c:\\users\\Username...')
    #1 C:\Users\Username\Documents\PhpstormProjects\project_name\vendor\vimeo\psalm\src\Psalm\Internal\Analyzer\Statements\ExpressionAnalyzer.php(462): Psalm\Internal\Analyzer\ClosureAnalyzer->__construct(Object(PhpParser\Node\Expr\Closure), Object(Psalm\Internal\Analyzer\StatementsAnalyzer))
    #2 C:\Users\Username\Documents\PhpstormProjects\project_name\vendor\vimeo\psalm\src\Psalm\Internal\Analyzer\Statements\Expression\CallAnalyzer.php(542): Psalm\Internal\Analyzer\Statements\ExpressionAnalyzer::analyze(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Expr\Closure), Object(Psalm\Context))
    #3 C:\Users\Username\Documents\PhpstormProjects\project_name\vendor\vimeo\psalm\src\Psalm\Internal\Analyzer\Statements\Expression\Call\FunctionCallAnalyzer.php(421): Psalm\Internal\Analyzer\Statements\Expression\CallAnalyzer::checkFunctionArguments(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Array, Array, 'uasort', Object(Psalm\Context))
    #4 C:\Users\Username\Documents\PhpstormProjects\project_name\vendor\vimeo\psalm\src\Psalm\Internal\Analyzer\Statements\ExpressionAnalyzer.php(442): Psalm\Internal\Analyzer\Statements\Expression\Call\FunctionCallAnalyzer::analyze(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Expr\FuncCall), Object(Psalm\Context))
    #5 C:\Users\Username\Documents\PhpstormProjects\project_name\vendor\vimeo\psalm\src\Psalm\Internal\Analyzer\StatementsAnalyzer.php(683): Psalm\Internal\Analyzer\Statements\ExpressionAnalyzer::analyze(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Expr\FuncCall), Object(Psalm\Context), false, NULL, true)
    #6 C:\Users\Username\Documents\PhpstormProjects\project_name\vendor\vimeo\psalm\src\Psalm\Internal\Analyzer\Statements\Block\IfAnalyzer.php(738): Psalm\Internal\Analyzer\StatementsAnalyzer->analyze(Array, Object(Psalm\Context))
    #7 C:\Users\Username\Documents\PhpstormProjects\project_name\vendor\vimeo\psalm\src\Psalm\Internal\Analyzer\Statements\Block\IfAnalyzer.php(345): Psalm\Internal\Analyzer\Statements\Block\IfAnalyzer::analyzeIfBlock(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Stmt\If_), Object(Psalm\Internal\Scope\IfScope), Object(Psalm\Context), Object(Psalm\Context), Object(Psalm\Context), Array)
    #8 C:\Users\Username\Documents\PhpstormProjects\project_name\vendor\vimeo\psalm\src\Psalm\Internal\Analyzer\StatementsAnalyzer.php(359): Psalm\Internal\Analyzer\Statements\Block\IfAnalyzer::analyze(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Stmt\If_), Object(Psalm\Context))
    #9 C:\Users\Username\Documents\PhpstormProjects\project_name\vendor\vimeo\psalm\src\Psalm\Internal\Analyzer\FunctionLikeAnalyzer.php(526): Psalm\Internal\Analyzer\StatementsAnalyzer->analyze(Array, Object(Psalm\Context), Object(Psalm\Context), true)
    #10 C:\Users\Username\Documents\PhpstormProjects\project_name\vendor\vimeo\psalm\src\Psalm\Internal\Analyzer\ClassAnalyzer.php(1650): Psalm\Internal\Analyzer\FunctionLikeAnalyzer->analyze(Object(Psalm\Context), Object(Psalm\Internal\Provider\NodeDataProvider), Object(Psalm\Context))
    #11 C:\Users\Username\Documents\PhpstormProjects\project_name\vendor\vimeo\psalm\src\Psalm\Internal\Analyzer\ClassAnalyzer.php(813): Psalm\Internal\Analyzer\ClassAnalyzer->analyzeClassMethod(Object(PhpParser\Node\Stmt\ClassMethod), Object(Psalm\Storage\ClassLikeStorage), Object(Psalm\Internal\Analyzer\ClassAnalyzer), Object(Psalm\Context), Object(Psalm\Context))
    #12 C:\Users\Username\Documents\PhpstormProjects\project_name\vendor\vimeo\psalm\src\Psalm\Internal\Analyzer\FileAnalyzer.php(201): Psalm\Internal\Analyzer\ClassAnalyzer->analyze(Object(Psalm\Context), Object(Psalm\Context))
    #13 C:\Users\Username\Documents\PhpstormProjects\project_name\vendor\vimeo\psalm\src\Psalm\Internal\Codebase\Analyzer.php(335): Psalm\Internal\Analyzer\FileAnalyzer->analyze(NULL)
    #14 C:\Users\Username\Documents\PhpstormProjects\project_name\vendor\vimeo\psalm\src\Psalm\Internal\Codebase\Analyzer.php(567): Psalm\Internal\Codebase\Analyzer->Psalm\Internal\Codebase\{closure}(7004, 'C:\\Users\\Username...')
    #15 C:\Users\Username\Documents\PhpstormProjects\project_name\vendor\vimeo\psalm\src\Psalm\Internal\Codebase\Analyzer.php(258): Psalm\Internal\Codebase\Analyzer->doAnalysis(Object(Psalm\Internal\Analyzer\ProjectAnalyzer), 1)
    #16 C:\Users\Username\Documents\PhpstormProjects\project_name\vendor\vimeo\psalm\src\Psalm\Internal\Analyzer\ProjectAnalyzer.php(528): Psalm\Internal\Codebase\Analyzer->analyzeFiles(Object(Psalm\Internal\Analyzer\ProjectAnalyzer),1, false)
    #17 C:\Users\Username\Documents\PhpstormProjects\project_name\vendor\vimeo\psalm\src\psalm.php(553): Psalm\Internal\Analyzer\ProjectAnalyzer->check('C:\\Users\\Username...', false)
    #18 C:\Users\Username\Documents\PhpstormProjects\project_name\vendor\vimeo\psalm\psalm(2): require_once('C:\\Users\\Username...')
    #19 {main}
    (Psalm 3.8.3@389af1bfc739bfdff3f9e3dc7bd6499aee51a831 crashed due to an uncaught Throwable)
    

    I looked at the code, unfortunately, this particular file is thousands of line long and I couldn't reproduce on a smaller sample. I then tried to ignore this whole file but I had an other error which seems related:

    Exception
    Uncaught InvalidArgumentException: Could not get class storage for customer_name in C:\Users\Username\Documents\PhpstormProjects\project_name\vendor\vimeo\psalm\src\Psalm\Internal\Provider\ClassLikeStorageProvider.php:47
    Stack trace:
    #0 C:\Users\Username\Documents\PhpstormProjects\project_name\vendor\vimeo\psalm\src\Psalm\Internal\Codebase\ClassLikes.php(1447): Psalm\Internal\Provider\ClassLikeStorageProvider->get('customer_name')
    #1 C:\Users\Username\Documents\PhpstormProjects\project_name\vendor\vimeo\psalm\src\Psalm\Type\Reconciler.php(493): Psalm\Internal\Codebase\ClassLikes->getConstantForClass('customer_name', '$t_params_code_...', 4, NULL)
    #2 C:\Users\Username\Documents\PhpstormProjects\project_name\vendor\vimeo\psalm\src\Psalm\Type\Reconciler.php(229): Psalm\Type\Reconciler::getValueForKey(Object(Psalm\Codebase), 'customer_name::$t_para...', Array, Object(Psalm\CodeLocation), false, false)
    #3 C:\Users\Username\Documents\PhpstormProjects\project_name\vendor\vimeo\psalm\src\Psalm\Internal\Analyzer\Statements\Block\IfAnalyzer.php(256): Psalm\Type\Reconciler::reconcileKeyedTypes(Array, Array, Array, Array, Array, Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Array, true, Object(Psalm\CodeLocation))
    #4 C:\Users\Username\Documents\PhpstormProjects\project_name\vendor\vimeo\psalm\src\Psalm\Internal\Analyzer\StatementsAnalyzer.php(359): Psalm\Internal\Analyzer\Statements\Block\IfAnalyzer::analyze(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Stmt\If_), Object(Psalm\Context))
    #5 C:\Users\Username\Documents\PhpstormProjects\project_name\vendor\vimeo\psalm\src\Psalm\Internal\Analyzer\Statements\Block\LoopAnalyzer.php(195): Psalm\Internal\Analyzer\StatementsAnalyzer->analyze(Array, Object(Psalm\Context))
    #6 C:\Users\Username\Documents\PhpstormProjects\project_name\vendor\vimeo\psalm\src\Psalm\Internal\Analyzer\Statements\Block\ForeachAnalyzer.php(308): Psalm\Internal\Analyzer\Statements\Block\LoopAnalyzer::analyze(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Array, Array, Array, Object(Psalm\Internal\Scope\LoopScope), Object(Psalm\Context))
    #7 C:\Users\Username\Documents\PhpstormProjects\project_name\vendor\vimeo\psalm\src\Psalm\Internal\Analyzer\StatementsAnalyzer.php(371): Psalm\Internal\Analyzer\Statements\Block\ForeachAnalyzer::analyze(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Stmt\Foreach_), Object(Psalm\Context))
    #8 C:\Users\Username\Documents\PhpstormProjects\project_name\vendor\vimeo\psalm\src\Psalm\Internal\Analyzer\Statements\Block\IfAnalyzer.php(1553): Psalm\Internal\Analyzer\StatementsAnalyzer->analyze(Array, Object(Psalm\Context))
    #9 C:\Users\Username\Documents\PhpstormProjects\project_name\vendor\vimeo\psalm\src\Psalm\Internal\Analyzer\Statements\Block\IfAnalyzer.php(382): Psalm\Internal\Analyzer\Statements\Block\IfAnalyzer::analyzeElseBlock(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Stmt\Else_), Object(Psalm\Internal\Scope\IfScope), Object(Psalm\Context), Object(Psalm\Context))
    #10 C:\Users\Username\Documents\PhpstormProjects\project_name\vendor\vimeo\psalm\src\Psalm\Internal\Analyzer\StatementsAnalyzer.php(359): Psalm\Internal\Analyzer\Statements\Block\IfAnalyzer::analyze(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Stmt\If_), Object(Psalm\Context))
    #11 C:\Users\Username\Documents\PhpstormProjects\project_name\vendor\vimeo\psalm\src\Psalm\Internal\Analyzer\FunctionLikeAnalyzer.php(526): Psalm\Internal\Analyzer\StatementsAnalyzer->analyze(Array, Object(Psalm\Context), Object(Psalm\Context), true)
    #12 C:\Users\Username\Documents\PhpstormProjects\project_name\vendor\vimeo\psalm\src\Psalm\Internal\Analyzer\ClassAnalyzer.php(1650): Psalm\Internal\Analyzer\FunctionLikeAnalyzer->analyze(Object(Psalm\Context), Object(Psalm\Internal\Provider\NodeDataProvider), Object(Psalm\Context))
    #13 C:\Users\Username\Documents\PhpstormProjects\project_name\vendor\vimeo\psalm\src\Psalm\Internal\Analyzer\ClassAnalyzer.php(813): Psalm\Internal\Analyzer\ClassAnalyzer->analyzeClassMethod(Object(PhpParser\Node\Stmt\ClassMethod), Object(Psalm\Storage\ClassLikeStorage), Object(Psalm\Internal\Analyzer\ClassAnalyzer), Object(Psalm\Context), Object(Psalm\Context))
    #14 C:\Users\Username\Documents\PhpstormProjects\project_name\vendor\vimeo\psalm\src\Psalm\Internal\Analyzer\FileAnalyzer.php(201): Psalm\Internal\Analyzer\ClassAnalyzer->analyze(Object(Psalm\Context), Object(Psalm\Context))
    #15 C:\Users\Username\Documents\PhpstormProjects\project_name\vendor\vimeo\psalm\src\Psalm\Internal\Codebase\Analyzer.php(335): Psalm\Internal\Analyzer\FileAnalyzer->analyze(NULL)
    #16 C:\Users\Username\Documents\PhpstormProjects\project_name\vendor\vimeo\psalm\src\Psalm\Internal\Codebase\Analyzer.php(567): Psalm\Internal\Codebase\Analyzer->Psalm\Internal\Codebase\{closure}(7269, 'C:\\Users\\Username...')
    #17 C:\Users\Username\Documents\PhpstormProjects\project_name\vendor\vimeo\psalm\src\Psalm\Internal\Codebase\Analyzer.php(258): Psalm\Internal\Codebase\Analyzer->doAnalysis(Object(Psalm\Internal\Analyzer\ProjectAnalyzer), 1)
    #18 C:\Users\Username\Documents\PhpstormProjects\project_name\vendor\vimeo\psalm\src\Psalm\Internal\Analyzer\ProjectAnalyzer.php(528): Psalm\Internal\Codebase\Analyzer->analyzeFiles(Object(Psalm\Internal\Analyzer\ProjectAnalyzer),1, false)
    #19 C:\Users\Username\Documents\PhpstormProjects\project_name\vendor\vimeo\psalm\src\psalm.php(553): Psalm\Internal\Analyzer\ProjectAnalyzer->check('C:\\Users\\Username...', false)
    #20 C:\Users\Username\Documents\PhpstormProjects\project_name\vendor\vimeo\psalm\psalm(2): require_once('C:\\Users\\Username...')
    #21 {main}
    (Psalm 3.8.3@389af1bfc739bfdff3f9e3dc7bd6499aee51a831 crashed due to an uncaught Throwable)
    

    The "customer_name" string comes back on the second error so I guess those errors are related.

    I don't have a code example to produce (as I said, I couldn't reproduce and the highlighted code was just a standard closure).

    Do you have any hints what could cause that kind of errors or things I could try to fix it?

    (Note: I couldn't make a lot of tests, our project is quite massive and it takes almost half an hour before failing...)

    more info needed 
    opened by orklah 37
  • Generic type inference regression bug

    Generic type inference regression bug

    I started experiencing this issue after updating Psalm. I was several releases behind before I updated to 4.10.0. Here is my attempt at a simplish reproduce that hopefully is the same issue.

    https://psalm.dev/r/e0a37d1235

    easy problems templates Help wanted 
    opened by still-dreaming-1 33
  • Psalter must check `@inheritdoc` tag

    Psalter must check `@inheritdoc` tag

    Source code: https://psalm.dev/r/107f171a6e After psalter --issues=all, expected result - no changes, current result:

    class A
    {
        /**
         * @var string Base Url
         * @psalm-var ''
         */
        public $baseUrl = '';
    }
    class B extends A
    {
        /**
         * @inheritDoc
         * @var string
         * @psalm-var '...'
         */
        public $baseUrl = '...';
    }
    
    opened by WinterSilence 33
  • Psalm uses its own types to analyse third-party code when installed globally

    Psalm uses its own types to analyse third-party code when installed globally

    I've noticed this when I tried to build psalm as phar. In humbug/box there's an option to strip down docblocks, and results from psalm.phar were different (one additional issue on my codebase, tons of issues reported on psalm's own codebase) depending on whether that option was enabled or not.

    If this is the case, it may lead to subtle (or not-so-subtle) bugs. Imagine you're using symfony/console:1.0 and the codebase analysed uses symfony/console:4.0 - should there be any class name clashes psalm would be using it's own version (1.0) to analyse the code that actually works with another version (4.0).

    I see references to \Reflection* which suggests that psalm actually loads and executes files - consequently you cannot have several versions of the same class loaded. Have you considered roave/better-reflection (that advertises that it doesn't execute parsed files) instead?

    bug 
    opened by weirdan 31
  • Update config defaults to be safer

    Update config defaults to be safer

    Change defaults on the following:

    • addParamDefaultToDocblockType (false to true)
    • ensureArrayIntOffsetsExist (false to true)
    • ensureArrayStringOffsetsExist (false to true)
    • findUnusedVariablesAndParams (false to true)
    • findUnusedPsalmSuppress (false to true)
    • ignoreInternalFunctionFalseReturn (false to true)
    • ignoreInternalFunctionNullReturn (false to true)
    • memoizeMethodCallResults (this should probably be removed, since it is just a bad assumption)
    • sealAllMethods (false to true)
    • sealAllProperties (false to true)
    • ... probably many more

    I think the default configuration of Psalm should attempt to make the least assumptions about the users code base.

    Tell me what you think or why these should remain as is.

    opened by jack-worman 1
  • Bump mheap/github-action-required-labels from 2 to 3

    Bump mheap/github-action-required-labels from 2 to 3

    Bumps mheap/github-action-required-labels from 2 to 3.

    Release notes

    Sourced from mheap/github-action-required-labels's releases.

    v3

    Tag that always points to the latest commit in the v3.x.x series of releases

    v3.0.0

    What's Changed

    Full Changelog: https://github.com/mheap/github-action-required-labels/compare/v2.2.3...v3.0.0

    v2.2.3

    What's Changed

    Full Changelog: https://github.com/mheap/github-action-required-labels/compare/v2.2.2...v2.2.3

    v2.2.2

    What's Changed

    Full Changelog: https://github.com/mheap/github-action-required-labels/compare/v2.2.1...v2.2.2

    v2.2.1

    • Adding node16 support

    v2.2.0

    What's Changed

    Full Changelog: https://github.com/mheap/github-action-required-labels/compare/v2.1.0...v2.2.0

    v2.1.0

    What's Changed

    Full Changelog: https://github.com/mheap/github-action-required-labels/compare/v2.0.1...v2.1.0

    v2.0.1

    What's Changed

    New Contributors

    Full Changelog: https://github.com/mheap/github-action-required-labels/compare/v2.0.0...v2.0.1

    Commits
    • 179af84 Automatic compilation
    • e49d4be Bump json5 from 2.2.1 to 2.2.2
    • 6008ef3 Add ability to customise comment / error message
    • 43f0d74 Bump README to v3
    • 6831eb2 Move from actions-toolkit to @​actions/core
    • See full diff in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    release:internal dependencies 
    opened by dependabot[bot] 0
  • Broken assert for array and list - DocblockTypeContradiction

    Broken assert for array and list - DocblockTypeContradiction

    https://psalm.dev/r/ea9ecf75b9

    As we see in line 20, psalm correctly infers that $foo can be type list when checking with array_values

    When using a custom assert function, it correctly asserts it, but reports a false positive DocblockTypeContradiction on the if condition in line 23

    What actually happens here is, that it assumes that @psalm-assert type array<string, string> does not contain list<string> which is correct - however why does it report this as a DocblockTypeContradiction in the place where the function is called?

    How can I assert if true => list<string>, if false => array<string, string>?

    bug docblock assertions 
    opened by kkmuffme 7
  • Deprecation message breaks JSON output

    Deprecation message breaks JSON output

    https://github.com/psalm/codeception-psalm-module/actions/runs/3810538569/jobs/6482681536#step:10:283

    Failed to parse output: Warning: "findUnusedCode" will be defaulted to "true" in Psalm 6. You should explicitly enable or disable this setting.
    

    This has the potential to break tests for most of the plugins. The Codeception module used for testing redirects STDERR to STDOUT, so the JSON it then tries to read won't be valid.

    /cc: @jack-worman

    opened by weirdan 4
  • MixedAssignment even when typeguard with is_string

    MixedAssignment even when typeguard with is_string

    https://psalm.dev/r/a9ffa2e239

    $text should be string, not ''|mixed

    Seems to be a related/a simplified version of https://github.com/vimeo/psalm/issues/6600 ?

    bug type reconciliation 
    opened by kkmuffme 3
Releases(5.4.0)
  • 5.4.0(Dec 19, 2022)

    What's Changed

    Features

    • ReflectionClass stub updates by @jack-worman in https://github.com/vimeo/psalm/pull/8933

    Fixes

    • Fix getParentClass stub by @VincentLanglet in https://github.com/vimeo/psalm/pull/8931
    • Allow conditions inside loops to preserve or narrow int range by @theodorejb in https://github.com/vimeo/psalm/pull/8934
    • More array fixes by @danog in https://github.com/vimeo/psalm/pull/8943

    Internal changes

    • Trailing commas by @jack-worman in https://github.com/vimeo/psalm/pull/8927

    Full Changelog: https://github.com/vimeo/psalm/compare/5.3.0...5.4.0

    Source code(tar.gz)
    Source code(zip)
    psalm.phar(11.40 MB)
    psalm.phar.asc(488 bytes)
  • 5.3.0(Dec 18, 2022)

    What's Changed

    Features

    • Declaring more precise types and purity boundaries on ext-reflection symbols in .phpstub files by @Ocramius in https://github.com/vimeo/psalm/pull/8722
    • Literal inferring for array_column, array_combine, array_fill_keys, array_fill by @danog in https://github.com/vimeo/psalm/pull/8850
    • Recognize casts from object-with-properties to array by @weirdan in https://github.com/vimeo/psalm/pull/8913

    Fixes

    • List refactoring v5 by @danog in https://github.com/vimeo/psalm/pull/8820
    • Improve parsing of list shapes by @danog in https://github.com/vimeo/psalm/pull/8841
    • Fix DOM and Reflection unreflectable methods by @othercorey in https://github.com/vimeo/psalm/pull/8899
    • Fix remaining invalid unreflectable methods by @othercorey in https://github.com/vimeo/psalm/pull/8900
    • Fix array_merge edge case by @danog in https://github.com/vimeo/psalm/pull/8907
    • fix return type never for static function calls by @kkmuffme in https://github.com/vimeo/psalm/pull/8902
    • Fix DOMDocument's propertery name preserveWhiteSpace by @sasezaki in https://github.com/vimeo/psalm/pull/8918
    • Make sprintf return non-empty-string when possible by @fluffycondor in https://github.com/vimeo/psalm/pull/8922
    • More array_merge improvements by @danog in https://github.com/vimeo/psalm/pull/8924
    • Make md5 return type more precise by @fluffycondor in https://github.com/vimeo/psalm/pull/8928
    • Fix #8923 by @danog in https://github.com/vimeo/psalm/pull/8929
    • Skip intersection of template types during inheritance check by @danog in https://github.com/vimeo/psalm/pull/8926
    • Fix ReflectionClass stub by @VincentLanglet in https://github.com/vimeo/psalm/pull/8930

    Docs

    • doc: FilterIterator added to list of built-in templates. by @d4s6 in https://github.com/vimeo/psalm/pull/8917

    Internal changes

    • Replace unmaintained openlss/lib-array2xml with spatie/array-to-xml by @weirdan in https://github.com/vimeo/psalm/pull/8895
    • Add validation for Class::Method names in CallMap by @othercorey in https://github.com/vimeo/psalm/pull/8826
    • Use rector to add property typehints by @jack-worman in https://github.com/vimeo/psalm/pull/8887
    • Add property typehints in Internal directory by @jack-worman in https://github.com/vimeo/psalm/pull/8897
    • Deprecation message on loading php-ext stubs without explicitly declaring them as dependency or in a config by @lptn in https://github.com/vimeo/psalm/pull/8885
    • Last property typehints by @jack-worman in https://github.com/vimeo/psalm/pull/8910
    • Remove useless ifs by @jack-worman in https://github.com/vimeo/psalm/pull/8916

    New Contributors

    • @d4s6 made their first contribution in https://github.com/vimeo/psalm/pull/8917

    Full Changelog: https://github.com/vimeo/psalm/compare/5.2.0...5.3.0

    Source code(tar.gz)
    Source code(zip)
    psalm.phar(11.39 MB)
    psalm.phar.asc(488 bytes)
  • 5.2.0(Dec 12, 2022)

    What's Changed

    Features

    • Add missing ZipArchive methods to CallMap (PHP 8.2) by @lptn in https://github.com/vimeo/psalm/pull/8869
    • Add libxml_get_external_entity_loader to CallMap (PHP 8.2) by @lptn in https://github.com/vimeo/psalm/pull/8871
    • Allow true in native types by @weirdan in https://github.com/vimeo/psalm/pull/8875
    • Add some missing sodium functions to CallMap by @lptn in https://github.com/vimeo/psalm/pull/8870
    • Forbid most magic methods on enums by @weirdan in https://github.com/vimeo/psalm/pull/8890

    Fixes

    • Fix crash when using phantom methods as first-class callable by @weirdan in https://github.com/vimeo/psalm/pull/8814
    • Don't crash when accessing immutable static property by @weirdan in https://github.com/vimeo/psalm/pull/8816
    • Prevent crashes on conditional traits by @weirdan in https://github.com/vimeo/psalm/pull/8817
    • Update dictionaries: use more specific boolean types by @lptn in https://github.com/vimeo/psalm/pull/8823
    • Fix return types for date functions in callmap by @othercorey in https://github.com/vimeo/psalm/pull/8825
    • Improve source autodiscovery failure message by @weirdan in https://github.com/vimeo/psalm/pull/8827
    • fix missing break handling in loop by @orklah in https://github.com/vimeo/psalm/pull/8828
    • capitalize properties by @orklah in https://github.com/vimeo/psalm/pull/8831
    • mysqli_execute_query accepts any type of param by @kamil-tekiela in https://github.com/vimeo/psalm/pull/8832
    • Fix parsing of class string of unions by @danog in https://github.com/vimeo/psalm/pull/8834
    • Extend impure_functions list by socket functions by @lptn in https://github.com/vimeo/psalm/pull/8835
    • Allowed taints to pass through urlencode() by @mmcev106 in https://github.com/vimeo/psalm/pull/8848
    • Precise count range by @VincentLanglet in https://github.com/vimeo/psalm/pull/8861
    • Fixed dynamic property on LanguageServer by @weirdan in https://github.com/vimeo/psalm/pull/8876
    • remove file_get_contents that was incorrectly put in v5 by @kkmuffme in https://github.com/vimeo/psalm/pull/8854
    • Prevent duplicate (Possibly)UnusedMethod/(Possibly)UnusedProperty by @weirdan in https://github.com/vimeo/psalm/pull/8883

    Internal changes

    • Bump fkirc/skip-duplicate-actions from 4.0.0 to 5.3.0 by @dependabot in https://github.com/vimeo/psalm/pull/8837
    • Integrate FidryCpuCoreCounter by @theofidry in https://github.com/vimeo/psalm/pull/8833
    • Upgrade CpuCoreCounter by @theofidry in https://github.com/vimeo/psalm/pull/8882

    Typos

    • Fixed typo by @jrcii in https://github.com/vimeo/psalm/pull/8864

    New Contributors

    • @jrcii made their first contribution in https://github.com/vimeo/psalm/pull/8864

    Full Changelog: https://github.com/vimeo/psalm/compare/5.1.0...5.2.0

    Source code(tar.gz)
    Source code(zip)
    psalm.phar(11.42 MB)
    psalm.phar.asc(488 bytes)
  • 5.1.0(Dec 2, 2022)

    What's Changed

    Deprecations

    • Defer cache directory creation until it's needed by @weirdan in https://github.com/vimeo/psalm/pull/8789

    Features

    • check "never" return type more strictly by @kkmuffme in https://github.com/vimeo/psalm/pull/8624
    • Report by issues grouped by level and type by @bdsl in https://github.com/vimeo/psalm/pull/8774

    Fixes

    • Ignore non-existing classes during initial scan of intersection types by @danog in https://github.com/vimeo/psalm/pull/8794
    • handle true/false reconciliation consistently, fix #8795 by @orklah in https://github.com/vimeo/psalm/pull/8796
    • fix sealed combination by @orklah in https://github.com/vimeo/psalm/pull/8798
    • Fix #8806 by @danog in https://github.com/vimeo/psalm/pull/8809

    Docs

    • Update installation.md - 5 requires PHP >= 7.4 by @sasezaki in https://github.com/vimeo/psalm/pull/8805
    • Adds documentation for the forbiddenFunctions config option by @p810 in https://github.com/vimeo/psalm/pull/8808

    New Contributors

    • @p810 made their first contribution in https://github.com/vimeo/psalm/pull/8808

    Full Changelog: https://github.com/vimeo/psalm/compare/5.0.0...5.1.0

    Source code(tar.gz)
    Source code(zip)
    psalm.phar(11.38 MB)
    psalm.phar.asc(488 bytes)
  • 5.0.0(Nov 30, 2022)

    Welcome to Psalm 5!

    There's an accompanying post on psalm.dev, written by @muglug & the current maintainers of Psalm.

    What's Changed

    Removed

    • Php version consistency by @orklah in https://github.com/vimeo/psalm/pull/6898
    • Removed TEmpty by @orklah in https://github.com/vimeo/psalm/pull/6662
    • remove support for allowPhpstormGenerics by @orklah in https://github.com/vimeo/psalm/pull/6705
    • remove exitFunctions for Psalm5 by @orklah in https://github.com/vimeo/psalm/pull/6808
    • Drop legacy procedural files by @weirdan in https://github.com/vimeo/psalm/pull/7270
    • Dropped removed config entries by @weirdan in https://github.com/vimeo/psalm/pull/7272
    • Dropped legacy plugin API by @weirdan in https://github.com/vimeo/psalm/pull/7275
    • Dropped deprecated CodeIssue methods by @weirdan in https://github.com/vimeo/psalm/pull/7276
    • Dropped deprecated DocComment methods by @weirdan in https://github.com/vimeo/psalm/pull/7278
    • Dropped THtmlEscapedString by @weirdan in https://github.com/vimeo/psalm/pull/7285
    • Drop orphaned token by @weirdan in https://github.com/vimeo/psalm/pull/7290
    • Bump PHP version to 7.4 by @weirdan in https://github.com/vimeo/psalm/pull/7291
    • Remove forbidEcho by @orklah in https://github.com/vimeo/psalm/pull/7420
    • remove TPositiveInt by @orklah in https://github.com/vimeo/psalm/pull/7473
    • Lock event classes by @weirdan in https://github.com/vimeo/psalm/pull/7491
    • [TASK] Add AfterFunctionLikeAnalysisEvent::getFunctionlikeStorage by @ohader in https://github.com/vimeo/psalm/pull/7526
    • Finalize (and internalize) more classes by @weirdan in https://github.com/vimeo/psalm/pull/7578
    • Finalize issues by @weirdan in https://github.com/vimeo/psalm/pull/7595
    • Finalize storages by @weirdan in https://github.com/vimeo/psalm/pull/7597
    • Finalize virtual nodes by @weirdan in https://github.com/vimeo/psalm/pull/7598
    • Finalize types nodes by @weirdan in https://github.com/vimeo/psalm/pull/7623
    • remove totallyTyped by @orklah in https://github.com/vimeo/psalm/pull/7651

    Features

    • Support PHPStan notation for empty-arrays by @orklah in https://github.com/vimeo/psalm/pull/7312
    • Try to provide literal int types when possible (fixes #6966) by @ricardoboss in https://github.com/vimeo/psalm/pull/7071
    • Allow config to define thread count by @M1ke in https://github.com/vimeo/psalm/pull/7442
    • Contextual type inference for high order function arg by @klimick in https://github.com/vimeo/psalm/pull/7417
    • feat: Handle native intersection types by @petewalker in https://github.com/vimeo/psalm/pull/7454
    • improve support for enum_exists by @orklah in https://github.com/vimeo/psalm/pull/7404
    • Support type annotations for class consts (fixes #942). by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7123
    • Improve class constant static analysis by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7154
    • Add support for references and improve UnusedVariable checks (fixes #7254). by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7339
    • InternalTaintSinkMap: Add getimagesize as SSRF sink by @mal-tee in https://github.com/vimeo/psalm/pull/7504
    • Enable extensions based on composer.json instead of those loaded at runtime (fixes #5482). by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7107
    • Dynamic function storage provider by @klimick in https://github.com/vimeo/psalm/pull/7471
    • ❗Allow plugins to modify Config::$fileExtensions early by @ohader in https://github.com/vimeo/psalm/pull/6789
    • [FEATURE] Introduce BeforeStatementAnalysisEvent by @ohader in https://github.com/vimeo/psalm/pull/7535
    • [FEATURE] Allow to intercept adding issue in IssueBuffer by @ohader in https://github.com/vimeo/psalm/pull/7530
    • Ensure all template parameters are specified in all extended|used classlikes by @danog in https://github.com/vimeo/psalm/pull/7492
    • feat: make key-of/value-of usable with non-const arrays by @Patrick-Remy in https://github.com/vimeo/psalm/pull/7396
    • More class const improvements. by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7666
    • Add @psalm-check-type and @psalm-check-type-exact. by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7686
    • feat(types): add properties-of type by @Patrick-Remy in https://github.com/vimeo/psalm/pull/7359
    • Invert meaning of dupe_key by @danog in https://github.com/vimeo/psalm/pull/7475
    • Feature: allow non-union assertion types by @boesing in https://github.com/vimeo/psalm/pull/8077
    • Allow value-of to work with backed enums (fixes #7874). by @AndrolGenhald in https://github.com/vimeo/psalm/pull/8283
    • Add capability to use inclusion files in a different directory (fix) by @gmessier in https://github.com/vimeo/psalm/pull/8402
    • Add dirname return type provider by @mcaskill in https://github.com/vimeo/psalm/pull/8611
    • Add stubs for ext-ffi by @LeSuisse in https://github.com/vimeo/psalm/pull/8614
    • add basename return type provider by @kkmuffme in https://github.com/vimeo/psalm/pull/8620
    • Add stubs for ext-random (PHP 8.2) by @lptn in https://github.com/vimeo/psalm/pull/8649
    • Add support for strict arrays, fix type alias intersection, fix array_is_list assertion on non-lists by @danog in https://github.com/vimeo/psalm/pull/8395
    • Add support for phpstan-param-out by @VincentLanglet in https://github.com/vimeo/psalm/pull/8678
    • add --no-progress to psalter by @kkmuffme in https://github.com/vimeo/psalm/pull/8709
    • Allow new on objects by @weirdan in https://github.com/vimeo/psalm/pull/8723

    Fixes

    • Use InvalidScalarArgument only when we can be sure PHP attempts coercion by @muglug in https://github.com/vimeo/psalm/pull/7188
    • Trim baseline selection by @weirdan in https://github.com/vimeo/psalm/pull/7279
    • Prevent NoValue when there is no phpdoc by @orklah in https://github.com/vimeo/psalm/pull/7399
    • create a return type provider for mb_internal_encoding by @orklah in https://github.com/vimeo/psalm/pull/7437
    • Array key exists assert both ways by @orklah in https://github.com/vimeo/psalm/pull/7449
    • [TypeProvider] Provide argument types during FunctionParamsProviderEvent by @veewee in https://github.com/vimeo/psalm/pull/7394
    • Fix stub parent class not loaded. by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7110
    • fix code where the offset was wrong by @orklah in https://github.com/vimeo/psalm/pull/7463
    • reconcile two arrays by intersecting them by @orklah in https://github.com/vimeo/psalm/pull/7470
    • fix error with 0 being considered positive by @orklah in https://github.com/vimeo/psalm/pull/7487
    • Fix crash due to unresolvable constant. by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7490
    • Fix failing case for const analyzer. by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7503
    • Fix side effect when loading config by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7506
    • improve literal inequality with ranges and rework GreaterThan/LessThan assertions by @orklah in https://github.com/vimeo/psalm/pull/7511
    • Remove mic-drop hack from if analysis by @muglug in https://github.com/vimeo/psalm/pull/7484
    • fix some iterator stubs by @orklah in https://github.com/vimeo/psalm/pull/6970
    • Fix empty array by @orklah in https://github.com/vimeo/psalm/pull/7517
    • add back empty keyword by @orklah in https://github.com/vimeo/psalm/pull/7533
    • Fix crash when assigning reference to unknown array offset by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7583
    • Fix #6683 by improving simplification of CNF by @muglug in https://github.com/vimeo/psalm/pull/7631
    • Enum collapsing by @orklah in https://github.com/vimeo/psalm/pull/7655
    • Enum assertions by @orklah in https://github.com/vimeo/psalm/pull/7662
    • Consistency for empty reconciliations by @orklah in https://github.com/vimeo/psalm/pull/7663
    • fix count with match on arrays by @orklah in https://github.com/vimeo/psalm/pull/7665
    • Prevent unnecessary filter_var() warnings on primitive types by @mmcev106 in https://github.com/vimeo/psalm/pull/7677
    • Improve bool to int casting. by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7696
    • Fix issues with int range unpacking and with min/max by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7699
    • Fix some minor issues with references. by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7684
    • restore callable-string Id by @orklah in https://github.com/vimeo/psalm/pull/7787
    • fix refining lowercase string and non-empty-string together by @orklah in https://github.com/vimeo/psalm/pull/7844
    • Remove @psalm-generator-return annotation by @jrmajor in https://github.com/vimeo/psalm/pull/7853
    • Resolve #7855 remove false from return type, in php8.0 and further ve… by @dkemper in https://github.com/vimeo/psalm/pull/7859
    • Fix class const issue when using floats declared in future consts (fixes #7973). by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7992
    • Improve handling of unsupported references (fixes #8018). by @AndrolGenhald in https://github.com/vimeo/psalm/pull/8022
    • Bring back disableVarParsing option by @danog in https://github.com/vimeo/psalm/pull/8058
    • Skip native classlike aliases by @danog in https://github.com/vimeo/psalm/pull/8080
    • Fix nasty parameter storage corruption bug by @danog in https://github.com/vimeo/psalm/pull/8098
    • Change return type of createFromInterface() on DateTime and DateTimeImmutable to static by @bitwise-operators in https://github.com/vimeo/psalm/pull/8102
    • Update DOM stub and add separate SimpleXML stub by @AndrolGenhald in https://github.com/vimeo/psalm/pull/8140
    • Track taints in static properties by @muglug in https://github.com/vimeo/psalm/pull/8150
    • Fix type reconciliation breaking Context::$references_in_scope (fixes #8289). by @AndrolGenhald in https://github.com/vimeo/psalm/pull/8306
    • Update CachingIterator::getCache stub. by @drupol in https://github.com/vimeo/psalm/pull/8282
    • Fix various array spread issues. by @AndrolGenhald in https://github.com/vimeo/psalm/pull/8044
    • Fix union assertions by @danog in https://github.com/vimeo/psalm/pull/8324
    • Add BitwiseNot and BooleanNot operators to SimpleTypeInferer by @bitwise-operators in https://github.com/vimeo/psalm/pull/8360
    • fix: Fix template resolution of complex extended types by @danog in https://github.com/vimeo/psalm/pull/8418
    • Fix mixed type hole when sending Foo to Foo by @muglug in https://github.com/vimeo/psalm/pull/8481
    • Fix type widening when Any assertion is used by @pvandommelen in https://github.com/vimeo/psalm/pull/8494
    • Fix callmap for DOMNode methods by @tvdijen in https://github.com/vimeo/psalm/pull/8566
    • Fix #8562 by @danog in https://github.com/vimeo/psalm/pull/8571
    • Fix #8569 by @danog in https://github.com/vimeo/psalm/pull/8570
    • Fix #6983 #8564 by @danog in https://github.com/vimeo/psalm/pull/8578
    • Fix template param for SplDoublyLinkedList by @ADmad in https://github.com/vimeo/psalm/pull/8579
    • Fix #8560 by @danog in https://github.com/vimeo/psalm/pull/8586
    • keep literal string for simple str_replace by @kkmuffme in https://github.com/vimeo/psalm/pull/8619
    • Mark hash_update functions as impure by @aboks in https://github.com/vimeo/psalm/pull/8658
    • Fix #8664 by @danog in https://github.com/vimeo/psalm/pull/8665
    • Fix #8669 by @danog in https://github.com/vimeo/psalm/pull/8670
    • Fix return type of ReflectionExtension::getVersion by @come-nc in https://github.com/vimeo/psalm/pull/8655
    • Making json_encode() always produce a non-empty-string, when successful by @Ocramius in https://github.com/vimeo/psalm/pull/8681
    • Emit DeprecatedInterface when interface is referenced in a generic by @weirdan in https://github.com/vimeo/psalm/pull/8687
    • Prevent array{a: Foo} going cleanly into array by @muglug in https://github.com/vimeo/psalm/pull/8691
    • Allow enum cases to reference constants by @weirdan in https://github.com/vimeo/psalm/pull/8694
    • Mark inferred mutation-free constructor as such by @weirdan in https://github.com/vimeo/psalm/pull/8692
    • Make stringable-object equivalent to Stringable by @weirdan in https://github.com/vimeo/psalm/pull/8688
    • Flag invalid enum case value types by @weirdan in https://github.com/vimeo/psalm/pull/8693
    • Add extra types to Memcache::getExtendedStats and Memcached::getStats by @bram123 in https://github.com/vimeo/psalm/pull/8700
    • Make array shapes strict by default by @muglug in https://github.com/vimeo/psalm/pull/8701
    • Add support for type aliases in @psalm-assert(-*) annotations by @annervisser in https://github.com/vimeo/psalm/pull/8705
    • Fix DateTimeZone::listAbbreviations return type by @franmomu in https://github.com/vimeo/psalm/pull/8717
    • Reject @psalm-consistent-constructor in function docblocks by @weirdan in https://github.com/vimeo/psalm/pull/8713
    • Allow using imported types in other types within the same file by @annervisser in https://github.com/vimeo/psalm/pull/8708
    • Argument 1 of curl_unescape by @kamil-tekiela in https://github.com/vimeo/psalm/pull/8730
    • Allow parameter types to be contained by a class template type by @danog in https://github.com/vimeo/psalm/pull/8731
    • Fix dictionary for strip_tags by @lptn in https://github.com/vimeo/psalm/pull/8729
    • Fix #8735: IntlDateFormatter CallMaps. by @niconoe- in https://github.com/vimeo/psalm/pull/8739
    • Fix #8748 by @danog in https://github.com/vimeo/psalm/pull/8749
    • Fix #8745 by @orklah in https://github.com/vimeo/psalm/pull/8753
    • Simplify assertions generated by an array_key_exists check by @muglug in https://github.com/vimeo/psalm/pull/8763
    • Suppress errors when validation regexps by @Chi-teck in https://github.com/vimeo/psalm/pull/8766
    • Upgrade humbug/box by @weirdan in https://github.com/vimeo/psalm/pull/8770
    • Replace all references to static variables when moving class by @weirdan in https://github.com/vimeo/psalm/pull/8780
    • Variables should outlive namespaces by @weirdan in https://github.com/vimeo/psalm/pull/8779
    • Check runtime requirements by @weirdan in https://github.com/vimeo/psalm/pull/8782
    • Fix crashes when XML report is used on PHP 8.1 by @weirdan in https://github.com/vimeo/psalm/pull/8788

    Docs

    • Dropped html-escaped-string docs by @weirdan in https://github.com/vimeo/psalm/pull/7281
    • Document BC breaks in #7358 by @weirdan in https://github.com/vimeo/psalm/pull/7360
    • Added documentation for baseline files by @ricardoboss in https://github.com/vimeo/psalm/pull/7429
    • Fix documentation for config. by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7564
    • Fix bullet indentation in documentation by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7565
    • doc about property initialization by @orklah in https://github.com/vimeo/psalm/pull/7593
    • Fix issue documentation links. by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7687
    • Improve documentation for InvalidGlobal to explain that it's sometimes valid by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7693
    • Fix int-mask-of doc example by @Seldaek in https://github.com/vimeo/psalm/pull/7812
    • Documented the allowMissingFiles attribute for ignoreFiles by @mmcev106 in https://github.com/vimeo/psalm/pull/7867
    • Fix a typo in MissingConstructor.md by @MidnightDesign in https://github.com/vimeo/psalm/pull/8023
    • PossiblyNullArgument: Adding common problem cases and possible solutions by @ThomasLandauer in https://github.com/vimeo/psalm/pull/8135
    • Adding note about referencedMethod by @ThomasLandauer in https://github.com/vimeo/psalm/pull/8408
    • Docs: Fix minor php syntax issues in code examples by @pchapl in https://github.com/vimeo/psalm/pull/8601
    • Update PossiblyFalseReference.md by @webmaster777 in https://github.com/vimeo/psalm/pull/8622
    • Last-minute docufix by @danog in https://github.com/vimeo/psalm/pull/8685
    • Fixing code formatting by @ThomasLandauer in https://github.com/vimeo/psalm/pull/8696
    • Fix formatting by @danog in https://github.com/vimeo/psalm/pull/8689
    • Removing list by @ThomasLandauer in https://github.com/vimeo/psalm/pull/8698
    • improve docs and phrasing about NoValue by @orklah in https://github.com/vimeo/psalm/pull/8754

    Internal changes

    • Disable PSL (not yet compatible with Psalm 5) by @weirdan in https://github.com/vimeo/psalm/pull/7269
    • Require @internal annotation on Psalm\Internal symbols by @weirdan in https://github.com/vimeo/psalm/pull/7268
    • Dropped deprecated TypeAnalyzer methods by @weirdan in https://github.com/vimeo/psalm/pull/7277
    • Moved getPsalmHelpText() to Cli\Psalm by @weirdan in https://github.com/vimeo/psalm/pull/7280
    • Replaced deprecated webmozart/path-util by @weirdan in https://github.com/vimeo/psalm/pull/7292
    • Indent heredoc by @weirdan in https://github.com/vimeo/psalm/pull/7294
    • Dropped dead code based on PHP_VERSION_ID by @weirdan in https://github.com/vimeo/psalm/pull/7300
    • Apply literal number separator rector by @weirdan in https://github.com/vimeo/psalm/pull/7299
    • Applied NullCoalescingOperatorRector by @weirdan in https://github.com/vimeo/psalm/pull/7302
    • Applied JsonThrowOnErrorRector by @weirdan in https://github.com/vimeo/psalm/pull/7303
    • Applied ListToArrayDestructRector by @weirdan in https://github.com/vimeo/psalm/pull/7310
    • replace array<never, never> as a way to detect empty arrays by a dedicated method by @orklah in https://github.com/vimeo/psalm/pull/7313
    • Applied ClosureToArrowFunctionRector by @weirdan in https://github.com/vimeo/psalm/pull/7315
    • Simplify object comparison by @muglug in https://github.com/vimeo/psalm/pull/7340
    • Rename was_static property to is_static to be more accurate by @muglug in https://github.com/vimeo/psalm/pull/7358
    • Add explicit resolveSymlinks option for project directories by @dvz in https://github.com/vimeo/psalm/pull/7163
    • Ensure that all entries in test arrays have explicit keys by @muglug in https://github.com/vimeo/psalm/pull/7386
    • TCallableString is non-falsy (0 can't be a functionlike name) by @orklah in https://github.com/vimeo/psalm/pull/6521
    • fix tests by @orklah in https://github.com/vimeo/psalm/pull/7446
    • Use objects, not strings, for assertions by @muglug in https://github.com/vimeo/psalm/pull/7410
    • Nitpicks by @orklah in https://github.com/vimeo/psalm/pull/7448
    • refactor description of types in Atomic by @orklah in https://github.com/vimeo/psalm/pull/7409
    • remove TPositiveInt usage for TIntRange by @orklah in https://github.com/vimeo/psalm/pull/7472
    • Fix ExceptionCodeTest provider shape by @weirdan in https://github.com/vimeo/psalm/pull/7538
    • Fix extension capitalization issue, add extensions to version message. by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7574
    • Added backward compatibility check by @weirdan in https://github.com/vimeo/psalm/pull/7576
    • Allow mocking final classes by @weirdan in https://github.com/vimeo/psalm/pull/7591
    • Fixed composer branch-alias by @sasezaki in https://github.com/vimeo/psalm/pull/7594
    • No longer require declare reflection-docblock:^5 as dependency by @sasezaki in https://github.com/vimeo/psalm/pull/7612
    • Bump up phpunit,prophecy, and introduced phpspec/prophecy-phpunit by @sasezaki in https://github.com/vimeo/psalm/pull/7617
    • consistency in AssertionFinder by @orklah in https://github.com/vimeo/psalm/pull/7622
    • skip a test because we removed the feature for now by @orklah in https://github.com/vimeo/psalm/pull/7642
    • Adjust for composer-require-checker check. by @sasezaki in https://github.com/vimeo/psalm/pull/7632
    • Removed .scrutinizer.yml by @sasezaki in https://github.com/vimeo/psalm/pull/7652
    • Use array_fill_keys() by @weirdan in https://github.com/vimeo/psalm/pull/7661
    • Fixed PSR-4 warnings by @weirdan in https://github.com/vimeo/psalm/pull/7683
    • chore: enable psl tests again by @azjezz in https://github.com/vimeo/psalm/pull/7596
    • Make callbacks marked as static by @SCIF in https://github.com/vimeo/psalm/pull/6695
    • Update master by @weirdan in https://github.com/vimeo/psalm/pull/8024
    • Run method call prohibition analyzer when cloning by @danog in https://github.com/vimeo/psalm/pull/8155
    • Avoid re-parsing template types by @danog in https://github.com/vimeo/psalm/pull/8181
    • Fix namespace of test by @danog in https://github.com/vimeo/psalm/pull/8191
    • update property map by @discordier in https://github.com/vimeo/psalm/pull/8000
    • Merge 4.x to master. by @AndrolGenhald in https://github.com/vimeo/psalm/pull/8222
    • Remove special handling for elseifs that breaks for else if by @muglug in https://github.com/vimeo/psalm/pull/8273
    • Applied ArraySpreadInsteadOfArrayMergeRector (take 2) by @weirdan in https://github.com/vimeo/psalm/pull/8345
    • Merge 4.x by @danog in https://github.com/vimeo/psalm/pull/8591
    • Immutable readonly atomics by @danog in https://github.com/vimeo/psalm/pull/8525
    • Immutable unions by @danog in https://github.com/vimeo/psalm/pull/8627
    • Merge 4.x and documentation fixes by @danog in https://github.com/vimeo/psalm/pull/8684
    • Fix PSL e2e tests by @danog in https://github.com/vimeo/psalm/pull/8697
    • Cleanup documentation by @danog in https://github.com/vimeo/psalm/pull/8702
    • safe delete cache directory files by @kkmuffme in https://github.com/vimeo/psalm/pull/8710
    • improve cache flush debug info and code if cache disabled by @kkmuffme in https://github.com/vimeo/psalm/pull/8707
    • Fix cache race condition due to missing repopulation of lock files cache by @kkmuffme in https://github.com/vimeo/psalm/pull/8714
    • include CLI args in PHP errors to more quickly identify run issues in CI by @kkmuffme in https://github.com/vimeo/psalm/pull/8724
    • Enforce arrow function formatting by @weirdan in https://github.com/vimeo/psalm/pull/8737
    • Simplify issue sorting by @weirdan in https://github.com/vimeo/psalm/pull/8736
    • Correct Clause::$hash type by @weirdan in https://github.com/vimeo/psalm/pull/8742
    • Fix #8743 by @orklah in https://github.com/vimeo/psalm/pull/8751
    • Switch from phpspec/prophecy to mockery/mockery by @weirdan in https://github.com/vimeo/psalm/pull/8755
    • Test CI on 8.2 by @orklah in https://github.com/vimeo/psalm/pull/8752
    • Move mockery plugin to require-dev by @weirdan in https://github.com/vimeo/psalm/pull/8769
    • bump lower dependencies by @orklah in https://github.com/vimeo/psalm/pull/8768
    • Add diagnostic message when shape fields are missing by @muglug in https://github.com/vimeo/psalm/pull/8762
    • Move mockery to require-dev too by @weirdan in https://github.com/vimeo/psalm/pull/8777
    • Bump slevomat/coding-standard by @weirdan in https://github.com/vimeo/psalm/pull/8783

    Typos

    • fix mapped property type for DOMNode childNodes by @cristianobaptista in https://github.com/vimeo/psalm/pull/8577
    • Fix typo by @zenahirsch in https://github.com/vimeo/psalm/pull/8605
    • Cleanup outdated comment by @andrew-demb in https://github.com/vimeo/psalm/pull/8699

    Other changes

    • Address flaw in type reconciliation on array references by @ohader in https://github.com/vimeo/psalm/pull/8290
    • Fix if propagation by @danog in https://github.com/vimeo/psalm/pull/8326
    • Begin immutable refactoring by @danog in https://github.com/vimeo/psalm/pull/8143
    • Fix properties-of on generic objects&intersections + immutable atomic refactoring by @danog in https://github.com/vimeo/psalm/pull/8442
    • Immutable assertions by @danog in https://github.com/vimeo/psalm/pull/8443

    New Contributors

    • @petewalker made their first contribution in https://github.com/vimeo/psalm/pull/7454
    • @mal-tee made their first contribution in https://github.com/vimeo/psalm/pull/7504
    • @Seldaek made their first contribution in https://github.com/vimeo/psalm/pull/7812
    • @dkemper made their first contribution in https://github.com/vimeo/psalm/pull/7859
    • @discordier made their first contribution in https://github.com/vimeo/psalm/pull/8000
    • @pvandommelen made their first contribution in https://github.com/vimeo/psalm/pull/8494
    • @cristianobaptista made their first contribution in https://github.com/vimeo/psalm/pull/8577
    • @pchapl made their first contribution in https://github.com/vimeo/psalm/pull/8601
    • @zenahirsch made their first contribution in https://github.com/vimeo/psalm/pull/8605
    • @mcaskill made their first contribution in https://github.com/vimeo/psalm/pull/8611
    • @webmaster777 made their first contribution in https://github.com/vimeo/psalm/pull/8622
    • @come-nc made their first contribution in https://github.com/vimeo/psalm/pull/8655
    • @bram123 made their first contribution in https://github.com/vimeo/psalm/pull/8700
    • @annervisser made their first contribution in https://github.com/vimeo/psalm/pull/8705
    • @Chi-teck made their first contribution in https://github.com/vimeo/psalm/pull/8766

    Full Changelog: https://github.com/vimeo/psalm/compare/4.30.0...5.0.0

    Source code(tar.gz)
    Source code(zip)
    psalm.phar(11.36 MB)
    psalm.phar.asc(488 bytes)
  • 5.0.0-rc1(Nov 23, 2022)

    This is the last pre-release before Psalm 5 official release

    What's Changed

    Removed

    • Php version consistency by @orklah in https://github.com/vimeo/psalm/pull/6898
    • Removed TEmpty by @orklah in https://github.com/vimeo/psalm/pull/6662
    • remove support for allowPhpstormGenerics by @orklah in https://github.com/vimeo/psalm/pull/6705
    • remove exitFunctions for Psalm5 by @orklah in https://github.com/vimeo/psalm/pull/6808
    • Drop legacy procedural files by @weirdan in https://github.com/vimeo/psalm/pull/7270
    • Dropped removed config entries by @weirdan in https://github.com/vimeo/psalm/pull/7272
    • Dropped legacy plugin API by @weirdan in https://github.com/vimeo/psalm/pull/7275
    • Dropped deprecated CodeIssue methods by @weirdan in https://github.com/vimeo/psalm/pull/7276
    • Dropped deprecated DocComment methods by @weirdan in https://github.com/vimeo/psalm/pull/7278
    • Dropped THtmlEscapedString by @weirdan in https://github.com/vimeo/psalm/pull/7285
    • Drop orphaned token by @weirdan in https://github.com/vimeo/psalm/pull/7290
    • Bump PHP version to 7.4 by @weirdan in https://github.com/vimeo/psalm/pull/7291
    • Remove forbidEcho by @orklah in https://github.com/vimeo/psalm/pull/7420
    • remove TPositiveInt by @orklah in https://github.com/vimeo/psalm/pull/7473
    • Lock event classes by @weirdan in https://github.com/vimeo/psalm/pull/7491
    • [TASK] Add AfterFunctionLikeAnalysisEvent::getFunctionlikeStorage by @ohader in https://github.com/vimeo/psalm/pull/7526
    • Finalize (and internalize) more classes by @weirdan in https://github.com/vimeo/psalm/pull/7578
    • Finalize issues by @weirdan in https://github.com/vimeo/psalm/pull/7595
    • Finalize storages by @weirdan in https://github.com/vimeo/psalm/pull/7597
    • Finalize virtual nodes by @weirdan in https://github.com/vimeo/psalm/pull/7598
    • Finalize types nodes by @weirdan in https://github.com/vimeo/psalm/pull/7623
    • remove totallyTyped by @orklah in https://github.com/vimeo/psalm/pull/7651

    Features

    • Support PHPStan notation for empty-arrays by @orklah in https://github.com/vimeo/psalm/pull/7312
    • Try to provide literal int types when possible (fixes #6966) by @ricardoboss in https://github.com/vimeo/psalm/pull/7071
    • Allow config to define thread count by @M1ke in https://github.com/vimeo/psalm/pull/7442
    • Contextual type inference for high order function arg by @klimick in https://github.com/vimeo/psalm/pull/7417
    • feat: Handle native intersection types by @petewalker in https://github.com/vimeo/psalm/pull/7454
    • improve support for enum_exists by @orklah in https://github.com/vimeo/psalm/pull/7404
    • Support type annotations for class consts (fixes #942). by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7123
    • Improve class constant static analysis by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7154
    • Add support for references and improve UnusedVariable checks (fixes #7254). by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7339
    • InternalTaintSinkMap: Add getimagesize as SSRF sink by @mal-tee in https://github.com/vimeo/psalm/pull/7504
    • Enable extensions based on composer.json instead of those loaded at runtime (fixes #5482). by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7107
    • Dynamic function storage provider by @klimick in https://github.com/vimeo/psalm/pull/7471
    • ❗Allow plugins to modify Config::$fileExtensions early by @ohader in https://github.com/vimeo/psalm/pull/6789
    • [FEATURE] Introduce BeforeStatementAnalysisEvent by @ohader in https://github.com/vimeo/psalm/pull/7535
    • [FEATURE] Allow to intercept adding issue in IssueBuffer by @ohader in https://github.com/vimeo/psalm/pull/7530
    • Ensure all template parameters are specified in all extended|used classlikes by @danog in https://github.com/vimeo/psalm/pull/7492
    • feat: make key-of/value-of usable with non-const arrays by @Patrick-Remy in https://github.com/vimeo/psalm/pull/7396
    • More class const improvements. by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7666
    • Add @psalm-check-type and @psalm-check-type-exact. by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7686
    • feat(types): add properties-of type by @Patrick-Remy in https://github.com/vimeo/psalm/pull/7359
    • Invert meaning of dupe_key by @danog in https://github.com/vimeo/psalm/pull/7475
    • Feature: allow non-union assertion types by @boesing in https://github.com/vimeo/psalm/pull/8077
    • Allow value-of to work with backed enums (fixes #7874). by @AndrolGenhald in https://github.com/vimeo/psalm/pull/8283
    • Add capability to use inclusion files in a different directory (fix) by @gmessier in https://github.com/vimeo/psalm/pull/8402
    • Add dirname return type provider by @mcaskill in https://github.com/vimeo/psalm/pull/8611
    • Add stubs for ext-ffi by @LeSuisse in https://github.com/vimeo/psalm/pull/8614
    • add basename return type provider by @kkmuffme in https://github.com/vimeo/psalm/pull/8620
    • Add stubs for ext-random (PHP 8.2) by @lptn in https://github.com/vimeo/psalm/pull/8649
    • Add support for strict arrays, fix type alias intersection, fix array_is_list assertion on non-lists by @danog in https://github.com/vimeo/psalm/pull/8395
    • Add support for phpstan-param-out by @VincentLanglet in https://github.com/vimeo/psalm/pull/8678
    • add --no-progress to psalter by @kkmuffme in https://github.com/vimeo/psalm/pull/8709
    • Allow new on objects by @weirdan in https://github.com/vimeo/psalm/pull/8723

    Fixes

    • Use InvalidScalarArgument only when we can be sure PHP attempts coercion by @muglug in https://github.com/vimeo/psalm/pull/7188
    • Trim baseline selection by @weirdan in https://github.com/vimeo/psalm/pull/7279
    • Prevent NoValue when there is no phpdoc by @orklah in https://github.com/vimeo/psalm/pull/7399
    • create a return type provider for mb_internal_encoding by @orklah in https://github.com/vimeo/psalm/pull/7437
    • Array key exists assert both ways by @orklah in https://github.com/vimeo/psalm/pull/7449
    • [TypeProvider] Provide argument types during FunctionParamsProviderEvent by @veewee in https://github.com/vimeo/psalm/pull/7394
    • Fix stub parent class not loaded. by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7110
    • fix code where the offset was wrong by @orklah in https://github.com/vimeo/psalm/pull/7463
    • reconcile two arrays by intersecting them by @orklah in https://github.com/vimeo/psalm/pull/7470
    • fix error with 0 being considered positive by @orklah in https://github.com/vimeo/psalm/pull/7487
    • Fix crash due to unresolvable constant. by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7490
    • Fix failing case for const analyzer. by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7503
    • Fix side effect when loading config by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7506
    • improve literal inequality with ranges and rework GreaterThan/LessThan assertions by @orklah in https://github.com/vimeo/psalm/pull/7511
    • Remove mic-drop hack from if analysis by @muglug in https://github.com/vimeo/psalm/pull/7484
    • fix some iterator stubs by @orklah in https://github.com/vimeo/psalm/pull/6970
    • Fix empty array by @orklah in https://github.com/vimeo/psalm/pull/7517
    • add back empty keyword by @orklah in https://github.com/vimeo/psalm/pull/7533
    • Fix crash when assigning reference to unknown array offset by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7583
    • Fix #6683 by improving simplification of CNF by @muglug in https://github.com/vimeo/psalm/pull/7631
    • Enum collapsing by @orklah in https://github.com/vimeo/psalm/pull/7655
    • Enum assertions by @orklah in https://github.com/vimeo/psalm/pull/7662
    • Consistency for empty reconciliations by @orklah in https://github.com/vimeo/psalm/pull/7663
    • fix count with match on arrays by @orklah in https://github.com/vimeo/psalm/pull/7665
    • Prevent unnecessary filter_var() warnings on primitive types by @mmcev106 in https://github.com/vimeo/psalm/pull/7677
    • Improve bool to int casting. by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7696
    • Fix issues with int range unpacking and with min/max by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7699
    • Fix some minor issues with references. by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7684
    • restore callable-string Id by @orklah in https://github.com/vimeo/psalm/pull/7787
    • fix refining lowercase string and non-empty-string together by @orklah in https://github.com/vimeo/psalm/pull/7844
    • Remove @psalm-generator-return annotation by @jrmajor in https://github.com/vimeo/psalm/pull/7853
    • Resolve #7855 remove false from return type, in php8.0 and further ve… by @dkemper in https://github.com/vimeo/psalm/pull/7859
    • Fix class const issue when using floats declared in future consts (fixes #7973). by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7992
    • Improve handling of unsupported references (fixes #8018). by @AndrolGenhald in https://github.com/vimeo/psalm/pull/8022
    • Bring back disableVarParsing option by @danog in https://github.com/vimeo/psalm/pull/8058
    • Skip native classlike aliases by @danog in https://github.com/vimeo/psalm/pull/8080
    • Fix nasty parameter storage corruption bug by @danog in https://github.com/vimeo/psalm/pull/8098
    • Change return type of createFromInterface() on DateTime and DateTimeImmutable to static by @bitwise-operators in https://github.com/vimeo/psalm/pull/8102
    • Update DOM stub and add separate SimpleXML stub by @AndrolGenhald in https://github.com/vimeo/psalm/pull/8140
    • Track taints in static properties by @muglug in https://github.com/vimeo/psalm/pull/8150
    • Fix type reconciliation breaking Context::$references_in_scope (fixes #8289). by @AndrolGenhald in https://github.com/vimeo/psalm/pull/8306
    • Update CachingIterator::getCache stub. by @drupol in https://github.com/vimeo/psalm/pull/8282
    • Fix various array spread issues. by @AndrolGenhald in https://github.com/vimeo/psalm/pull/8044
    • Fix union assertions by @danog in https://github.com/vimeo/psalm/pull/8324
    • Add BitwiseNot and BooleanNot operators to SimpleTypeInferer by @bitwise-operators in https://github.com/vimeo/psalm/pull/8360
    • fix: Fix template resolution of complex extended types by @danog in https://github.com/vimeo/psalm/pull/8418
    • Fix mixed type hole when sending Foo to Foo by @muglug in https://github.com/vimeo/psalm/pull/8481
    • Fix type widening when Any assertion is used by @pvandommelen in https://github.com/vimeo/psalm/pull/8494
    • Fix callmap for DOMNode methods by @tvdijen in https://github.com/vimeo/psalm/pull/8566
    • Fix #8562 by @danog in https://github.com/vimeo/psalm/pull/8571
    • Fix #8569 by @danog in https://github.com/vimeo/psalm/pull/8570
    • Fix #6983 #8564 by @danog in https://github.com/vimeo/psalm/pull/8578
    • Fix template param for SplDoublyLinkedList by @ADmad in https://github.com/vimeo/psalm/pull/8579
    • Fix #8560 by @danog in https://github.com/vimeo/psalm/pull/8586
    • keep literal string for simple str_replace by @kkmuffme in https://github.com/vimeo/psalm/pull/8619
    • Mark hash_update functions as impure by @aboks in https://github.com/vimeo/psalm/pull/8658
    • Fix #8664 by @danog in https://github.com/vimeo/psalm/pull/8665
    • Fix #8669 by @danog in https://github.com/vimeo/psalm/pull/8670
    • Fix return type of ReflectionExtension::getVersion by @come-nc in https://github.com/vimeo/psalm/pull/8655
    • Making json_encode() always produce a non-empty-string, when successful by @Ocramius in https://github.com/vimeo/psalm/pull/8681
    • Emit DeprecatedInterface when interface is referenced in a generic by @weirdan in https://github.com/vimeo/psalm/pull/8687
    • Prevent array{a: Foo} going cleanly into array by @muglug in https://github.com/vimeo/psalm/pull/8691
    • Allow enum cases to reference constants by @weirdan in https://github.com/vimeo/psalm/pull/8694
    • Mark inferred mutation-free constructor as such by @weirdan in https://github.com/vimeo/psalm/pull/8692
    • Make stringable-object equivalent to Stringable by @weirdan in https://github.com/vimeo/psalm/pull/8688
    • Flag invalid enum case value types by @weirdan in https://github.com/vimeo/psalm/pull/8693
    • Add extra types to Memcache::getExtendedStats and Memcached::getStats by @bram123 in https://github.com/vimeo/psalm/pull/8700
    • Make array shapes strict by default by @muglug in https://github.com/vimeo/psalm/pull/8701
    • Add support for type aliases in @psalm-assert(-*) annotations by @annervisser in https://github.com/vimeo/psalm/pull/8705
    • Fix DateTimeZone::listAbbreviations return type by @franmomu in https://github.com/vimeo/psalm/pull/8717
    • Reject @psalm-consistent-constructor in function docblocks by @weirdan in https://github.com/vimeo/psalm/pull/8713
    • Allow using imported types in other types within the same file by @annervisser in https://github.com/vimeo/psalm/pull/8708
    • Argument 1 of curl_unescape by @kamil-tekiela in https://github.com/vimeo/psalm/pull/8730
    • Allow parameter types to be contained by a class template type by @danog in https://github.com/vimeo/psalm/pull/8731
    • Fix dictionary for strip_tags by @lptn in https://github.com/vimeo/psalm/pull/8729
    • Fix #8735: IntlDateFormatter CallMaps. by @niconoe- in https://github.com/vimeo/psalm/pull/8739

    Docs

    • Dropped html-escaped-string docs by @weirdan in https://github.com/vimeo/psalm/pull/7281
    • Document BC breaks in #7358 by @weirdan in https://github.com/vimeo/psalm/pull/7360
    • Added documentation for baseline files by @ricardoboss in https://github.com/vimeo/psalm/pull/7429
    • Fix documentation for config. by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7564
    • Fix bullet indentation in documentation by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7565
    • doc about property initialization by @orklah in https://github.com/vimeo/psalm/pull/7593
    • Fix issue documentation links. by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7687
    • Improve documentation for InvalidGlobal to explain that it's sometimes valid by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7693
    • Fix int-mask-of doc example by @Seldaek in https://github.com/vimeo/psalm/pull/7812
    • Documented the allowMissingFiles attribute for ignoreFiles by @mmcev106 in https://github.com/vimeo/psalm/pull/7867
    • Fix a typo in MissingConstructor.md by @MidnightDesign in https://github.com/vimeo/psalm/pull/8023
    • PossiblyNullArgument: Adding common problem cases and possible solutions by @ThomasLandauer in https://github.com/vimeo/psalm/pull/8135
    • Adding note about referencedMethod by @ThomasLandauer in https://github.com/vimeo/psalm/pull/8408
    • Docs: Fix minor php syntax issues in code examples by @pchapl in https://github.com/vimeo/psalm/pull/8601
    • Update PossiblyFalseReference.md by @webmaster777 in https://github.com/vimeo/psalm/pull/8622
    • Last-minute docufix by @danog in https://github.com/vimeo/psalm/pull/8685
    • Fixing code formatting by @ThomasLandauer in https://github.com/vimeo/psalm/pull/8696
    • Fix formatting by @danog in https://github.com/vimeo/psalm/pull/8689
    • Removing list by @ThomasLandauer in https://github.com/vimeo/psalm/pull/8698

    Internal changes

    • Disable PSL (not yet compatible with Psalm 5) by @weirdan in https://github.com/vimeo/psalm/pull/7269
    • Require @internal annotation on Psalm\Internal symbols by @weirdan in https://github.com/vimeo/psalm/pull/7268
    • Dropped deprecated TypeAnalyzer methods by @weirdan in https://github.com/vimeo/psalm/pull/7277
    • Moved getPsalmHelpText() to Cli\Psalm by @weirdan in https://github.com/vimeo/psalm/pull/7280
    • Replaced deprecated webmozart/path-util by @weirdan in https://github.com/vimeo/psalm/pull/7292
    • Indent heredoc by @weirdan in https://github.com/vimeo/psalm/pull/7294
    • Dropped dead code based on PHP_VERSION_ID by @weirdan in https://github.com/vimeo/psalm/pull/7300
    • Apply literal number separator rector by @weirdan in https://github.com/vimeo/psalm/pull/7299
    • Applied NullCoalescingOperatorRector by @weirdan in https://github.com/vimeo/psalm/pull/7302
    • Applied JsonThrowOnErrorRector by @weirdan in https://github.com/vimeo/psalm/pull/7303
    • Applied ListToArrayDestructRector by @weirdan in https://github.com/vimeo/psalm/pull/7310
    • replace array<never, never> as a way to detect empty arrays by a dedicated method by @orklah in https://github.com/vimeo/psalm/pull/7313
    • Applied ClosureToArrowFunctionRector by @weirdan in https://github.com/vimeo/psalm/pull/7315
    • Simplify object comparison by @muglug in https://github.com/vimeo/psalm/pull/7340
    • Rename was_static property to is_static to be more accurate by @muglug in https://github.com/vimeo/psalm/pull/7358
    • Add explicit resolveSymlinks option for project directories by @dvz in https://github.com/vimeo/psalm/pull/7163
    • Ensure that all entries in test arrays have explicit keys by @muglug in https://github.com/vimeo/psalm/pull/7386
    • TCallableString is non-falsy (0 can't be a functionlike name) by @orklah in https://github.com/vimeo/psalm/pull/6521
    • fix tests by @orklah in https://github.com/vimeo/psalm/pull/7446
    • Use objects, not strings, for assertions by @muglug in https://github.com/vimeo/psalm/pull/7410
    • Nitpicks by @orklah in https://github.com/vimeo/psalm/pull/7448
    • refactor description of types in Atomic by @orklah in https://github.com/vimeo/psalm/pull/7409
    • remove TPositiveInt usage for TIntRange by @orklah in https://github.com/vimeo/psalm/pull/7472
    • Fix ExceptionCodeTest provider shape by @weirdan in https://github.com/vimeo/psalm/pull/7538
    • Fix extension capitalization issue, add extensions to version message. by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7574
    • Added backward compatibility check by @weirdan in https://github.com/vimeo/psalm/pull/7576
    • Allow mocking final classes by @weirdan in https://github.com/vimeo/psalm/pull/7591
    • Fixed composer branch-alias by @sasezaki in https://github.com/vimeo/psalm/pull/7594
    • No longer require declare reflection-docblock:^5 as dependency by @sasezaki in https://github.com/vimeo/psalm/pull/7612
    • Bump up phpunit,prophecy, and introduced phpspec/prophecy-phpunit by @sasezaki in https://github.com/vimeo/psalm/pull/7617
    • consistency in AssertionFinder by @orklah in https://github.com/vimeo/psalm/pull/7622
    • skip a test because we removed the feature for now by @orklah in https://github.com/vimeo/psalm/pull/7642
    • Adjust for composer-require-checker check. by @sasezaki in https://github.com/vimeo/psalm/pull/7632
    • Removed .scrutinizer.yml by @sasezaki in https://github.com/vimeo/psalm/pull/7652
    • Use array_fill_keys() by @weirdan in https://github.com/vimeo/psalm/pull/7661
    • Fixed PSR-4 warnings by @weirdan in https://github.com/vimeo/psalm/pull/7683
    • chore: enable psl tests again by @azjezz in https://github.com/vimeo/psalm/pull/7596
    • Make callbacks marked as static by @SCIF in https://github.com/vimeo/psalm/pull/6695
    • Update master by @weirdan in https://github.com/vimeo/psalm/pull/8024
    • Run method call prohibition analyzer when cloning by @danog in https://github.com/vimeo/psalm/pull/8155
    • Avoid re-parsing template types by @danog in https://github.com/vimeo/psalm/pull/8181
    • Fix namespace of test by @danog in https://github.com/vimeo/psalm/pull/8191
    • update property map by @discordier in https://github.com/vimeo/psalm/pull/8000
    • Merge 4.x to master. by @AndrolGenhald in https://github.com/vimeo/psalm/pull/8222
    • Remove special handling for elseifs that breaks for else if by @muglug in https://github.com/vimeo/psalm/pull/8273
    • Applied ArraySpreadInsteadOfArrayMergeRector (take 2) by @weirdan in https://github.com/vimeo/psalm/pull/8345
    • Merge 4.x by @danog in https://github.com/vimeo/psalm/pull/8591
    • Immutable readonly atomics by @danog in https://github.com/vimeo/psalm/pull/8525
    • Immutable unions by @danog in https://github.com/vimeo/psalm/pull/8627
    • Merge 4.x and documentation fixes by @danog in https://github.com/vimeo/psalm/pull/8684
    • Fix PSL e2e tests by @danog in https://github.com/vimeo/psalm/pull/8697
    • Cleanup documentation by @danog in https://github.com/vimeo/psalm/pull/8702
    • safe delete cache directory files by @kkmuffme in https://github.com/vimeo/psalm/pull/8710
    • improve cache flush debug info and code if cache disabled by @kkmuffme in https://github.com/vimeo/psalm/pull/8707
    • Fix cache race condition due to missing repopulation of lock files cache by @kkmuffme in https://github.com/vimeo/psalm/pull/8714
    • include CLI args in PHP errors to more quickly identify run issues in CI by @kkmuffme in https://github.com/vimeo/psalm/pull/8724
    • Enforce arrow function formatting by @weirdan in https://github.com/vimeo/psalm/pull/8737
    • Simplify issue sorting by @weirdan in https://github.com/vimeo/psalm/pull/8736
    • Correct Clause::$hash type by @weirdan in https://github.com/vimeo/psalm/pull/8742

    Typos

    • fix mapped property type for DOMNode childNodes by @cristianobaptista in https://github.com/vimeo/psalm/pull/8577
    • Fix typo by @zenahirsch in https://github.com/vimeo/psalm/pull/8605
    • Cleanup outdated comment by @andrew-demb in https://github.com/vimeo/psalm/pull/8699

    Other changes

    • Address flaw in type reconciliation on array references by @ohader in https://github.com/vimeo/psalm/pull/8290
    • Fix if propagation by @danog in https://github.com/vimeo/psalm/pull/8326
    • Begin immutable refactoring by @danog in https://github.com/vimeo/psalm/pull/8143
    • Fix properties-of on generic objects&intersections + immutable atomic refactoring by @danog in https://github.com/vimeo/psalm/pull/8442
    • Immutable assertions by @danog in https://github.com/vimeo/psalm/pull/8443

    New Contributors

    • @petewalker made their first contribution in https://github.com/vimeo/psalm/pull/7454
    • @mal-tee made their first contribution in https://github.com/vimeo/psalm/pull/7504
    • @Seldaek made their first contribution in https://github.com/vimeo/psalm/pull/7812
    • @dkemper made their first contribution in https://github.com/vimeo/psalm/pull/7859
    • @discordier made their first contribution in https://github.com/vimeo/psalm/pull/8000
    • @pvandommelen made their first contribution in https://github.com/vimeo/psalm/pull/8494
    • @cristianobaptista made their first contribution in https://github.com/vimeo/psalm/pull/8577
    • @pchapl made their first contribution in https://github.com/vimeo/psalm/pull/8601
    • @zenahirsch made their first contribution in https://github.com/vimeo/psalm/pull/8605
    • @mcaskill made their first contribution in https://github.com/vimeo/psalm/pull/8611
    • @webmaster777 made their first contribution in https://github.com/vimeo/psalm/pull/8622
    • @come-nc made their first contribution in https://github.com/vimeo/psalm/pull/8655
    • @bram123 made their first contribution in https://github.com/vimeo/psalm/pull/8700
    • @annervisser made their first contribution in https://github.com/vimeo/psalm/pull/8705

    Full Changelog: https://github.com/vimeo/psalm/compare/4.30.0...5.0.0-rc1

    Source code(tar.gz)
    Source code(zip)
    psalm.phar(11.83 MB)
    psalm.phar.asc(488 bytes)
  • 4.30.0(Nov 6, 2022)

    What's Changed

    Features

    • Enhance type detection for internal php functions key, current, end and reset by @boesing in https://github.com/vimeo/psalm/pull/8584
    • Add dictionary delta for PHP 8.2 by @lptn in https://github.com/vimeo/psalm/pull/8634
    • Add support for phpstan assertions by @VincentLanglet in https://github.com/vimeo/psalm/pull/8654

    Fixes

    • Add additional checks for concat of non-empty strings to return non-falsy by @gphargreaves in https://github.com/vimeo/psalm/pull/8585
    • Correct return type of DateTimeImmutable sub method stub by @gphargreaves in https://github.com/vimeo/psalm/pull/8583
    • fix wrong php version id in $_FILES by @kkmuffme in https://github.com/vimeo/psalm/pull/8600
    • #7810/improve reflection stubs by @gphargreaves in https://github.com/vimeo/psalm/pull/8592
    • ensure callbacks have the required number of params by @kkmuffme in https://github.com/vimeo/psalm/pull/8594
    • Fix for issue #8631 by @hamburnyog in https://github.com/vimeo/psalm/pull/8639
    • Fix XMLReader::expand() nullable parameter $baseNode by @BenMorel in https://github.com/vimeo/psalm/pull/8641
    • Do not report serialize as unused by @VincentLanglet in https://github.com/vimeo/psalm/pull/8650
    • serialize is not pure for array of object by @VincentLanglet in https://github.com/vimeo/psalm/pull/8652
    • Fix Spl file handling signatures by @neclimdul in https://github.com/vimeo/psalm/pull/8644
    • Remove argc and argv elements from $_ENV by @weirdan in https://github.com/vimeo/psalm/pull/8666
    • adding openssl_x509_verify by @orklah in https://github.com/vimeo/psalm/pull/8677

    Internal changes

    • Allow to set PHP 8.2 version by @franmomu in https://github.com/vimeo/psalm/pull/8643
    • Fix assert testing callmap return types by @othercorey in https://github.com/vimeo/psalm/pull/8676

    New Contributors

    • @neclimdul made their first contribution in https://github.com/vimeo/psalm/pull/8644

    Full Changelog: https://github.com/vimeo/psalm/compare/4.29.0...4.30.0

    Source code(tar.gz)
    Source code(zip)
    psalm.phar(11.54 MB)
    psalm.phar.asc(488 bytes)
  • 4.29.0(Oct 11, 2022)

    What's Changed

    Fixes

    • Update dictionaries for hash ext functions by @lptn in https://github.com/vimeo/psalm/pull/8553
    • More specific superglobals feedback update by @kkmuffme in https://github.com/vimeo/psalm/pull/8561
    • Update Phpredis stubs to return false on failure by @kkmuffme in https://github.com/vimeo/psalm/pull/8555
    • Fix MinMaxReturnTypeProvider when handling TDependentListKeys by @nosnickid in https://github.com/vimeo/psalm/pull/8567

    New Contributors

    • @nosnickid made their first contribution in https://github.com/vimeo/psalm/pull/8567

    Full Changelog: https://github.com/vimeo/psalm/compare/4.28.0...4.29.0

    Source code(tar.gz)
    Source code(zip)
    psalm.phar(11.53 MB)
    psalm.phar.asc(488 bytes)
  • 4.28.0(Oct 7, 2022)

    What's Changed

    Features

    • Make ctype_digit and ctype_lower work as assertions by @fluffycondor in https://github.com/vimeo/psalm/pull/8450
    • report invalidCasing when using a class that is not user defined too by @kkmuffme in https://github.com/vimeo/psalm/pull/8465
    • Update call maps for MongoDB extension by @alcaeus in https://github.com/vimeo/psalm/pull/8432
    • Add dateTimeModify return type provider by @VincentLanglet in https://github.com/vimeo/psalm/pull/8462
    • make superglobals more specific by @kkmuffme in https://github.com/vimeo/psalm/pull/8473
    • Fix invalid casts int and float by @kkmuffme in https://github.com/vimeo/psalm/pull/8366
    • add hideAllErrorsExceptPassedFiles config option by @kkmuffme in https://github.com/vimeo/psalm/pull/8502
    • Add int type aliases based on existing codes by @hamburnyog in https://github.com/vimeo/psalm/pull/8530
    • Add check for class const with reserved word 'class' by @gphargreaves in https://github.com/vimeo/psalm/pull/8542

    Fixes

    • Fix ctype_digit assertion bug by @fluffycondor in https://github.com/vimeo/psalm/pull/8466
    • partial revert nullable type for curl_multi_getcontent by @kkmuffme in https://github.com/vimeo/psalm/pull/8367
    • classlike_alias incorrect casing not handled correctly by @kkmuffme in https://github.com/vimeo/psalm/pull/8468
    • Update phpredis.phpstub by @sergkash7 in https://github.com/vimeo/psalm/pull/8136
    • date_get_last_errors(), DateTime::getLastErrors() may return false by @gsteel in https://github.com/vimeo/psalm/pull/8478
    • Fix array_key_exists first argument false positive by @hirokinoue in https://github.com/vimeo/psalm/pull/8489
    • Fix array_column with object and column name null by @HypeMC in https://github.com/vimeo/psalm/pull/8491
    • Add null-type to several DOM-functions by @tvdijen in https://github.com/vimeo/psalm/pull/8490
    • Make Psalter add @throws annotation with properly namespaced exception by @d-claassen in https://github.com/vimeo/psalm/pull/8480
    • use cache for declared function when available before falling back to stubs by @kkmuffme in https://github.com/vimeo/psalm/pull/8503
    • fix crash in <PHP8 with ResourceBundle by @kkmuffme in https://github.com/vimeo/psalm/pull/8416
    • Fixed function signatures of imap_delete and imap_undelete by @ppdeblieck in https://github.com/vimeo/psalm/pull/8537

    Docs

    • Document the object with properties syntax by @HypeMC in https://github.com/vimeo/psalm/pull/8493
    • Make template constraints examples in docs consistent by @HypeMC in https://github.com/vimeo/psalm/pull/8492

    Internal changes

    • GitHub Workflows security hardening by @sashashura in https://github.com/vimeo/psalm/pull/8451
    • preg_replace with anchor will always only have 1 replacement by @kkmuffme in https://github.com/vimeo/psalm/pull/8469
    • Consistent error logging for cache by @kkmuffme in https://github.com/vimeo/psalm/pull/8415

    New Contributors

    • @sashashura made their first contribution in https://github.com/vimeo/psalm/pull/8451
    • @alcaeus made their first contribution in https://github.com/vimeo/psalm/pull/8432
    • @sergkash7 made their first contribution in https://github.com/vimeo/psalm/pull/8136
    • @gsteel made their first contribution in https://github.com/vimeo/psalm/pull/8478
    • @HypeMC made their first contribution in https://github.com/vimeo/psalm/pull/8493
    • @d-claassen made their first contribution in https://github.com/vimeo/psalm/pull/8480
    • @hamburnyog made their first contribution in https://github.com/vimeo/psalm/pull/8530
    • @ppdeblieck made their first contribution in https://github.com/vimeo/psalm/pull/8537
    • @gphargreaves made their first contribution in https://github.com/vimeo/psalm/pull/8542

    Full Changelog: https://github.com/vimeo/psalm/compare/4.27.0...4.28.0

    Source code(tar.gz)
    Source code(zip)
    psalm.phar(11.52 MB)
    psalm.phar.asc(488 bytes)
  • 4.27.0(Sep 1, 2022)

    What's Changed

    Features

    • added truthy-string alias for non-falsy-string by @staabm in https://github.com/vimeo/psalm/pull/8400
    • added SensitiveParameter, AllowDynamicProperties php 8.2 attributes by @staabm in https://github.com/vimeo/psalm/pull/8427
    • Allow *bin2hex and *bin2base64 functions to keep non-empty-string type by @LeSuisse in https://github.com/vimeo/psalm/pull/8431
    • Allow any attribute for complex types in schema by @den-kuz in https://github.com/vimeo/psalm/pull/8428
    • trim(), ltrim(), rtrim() now keep lowercase string attribute by @SCIF in https://github.com/vimeo/psalm/pull/8444

    Fixes

    • Added better stubs for DateTimeImmutable, highlighting how the constructor is NOT immutable by @Ocramius in https://github.com/vimeo/psalm/pull/8350
    • Use classlike_storage_provider only if it has the required data by @Daeroni in https://github.com/vimeo/psalm/pull/8376
    • Fix imageinterlace function signature by @paulfedorow in https://github.com/vimeo/psalm/pull/8403
    • Clarification of Reflection::getModifierNames() result type by @vjik in https://github.com/vimeo/psalm/pull/8405
    • Ensure we recognize inherited static methods for the first-class callables by @someniatko in https://github.com/vimeo/psalm/pull/8370
    • Add support for callable in array_reduce by @VincentLanglet in https://github.com/vimeo/psalm/pull/8435
    • Configure a correct attribute target in stubs/CoreGenericClasses.phpstub by @TimWolla in https://github.com/vimeo/psalm/pull/8436

    Internal changes

    • always use lock when writing/reading cache data to/from file by @kkmuffme in https://github.com/vimeo/psalm/pull/8372

    Typos

    • add ", but" for InvalidArgument error message where a type is provided by @kkmuffme in https://github.com/vimeo/psalm/pull/8364
    • Fix doc typos by @krsriq in https://github.com/vimeo/psalm/pull/8424

    New Contributors

    • @krsriq made their first contribution in https://github.com/vimeo/psalm/pull/8424
    • @den-kuz made their first contribution in https://github.com/vimeo/psalm/pull/8428

    Full Changelog: https://github.com/vimeo/psalm/compare/4.26.0...4.27.0

    Source code(tar.gz)
    Source code(zip)
    psalm.phar(11.48 MB)
    psalm.phar.asc(488 bytes)
  • 4.26.0(Aug 2, 2022)

    What's Changed

    This release fix an regression introduced in the last version. Upgrade is recommended

    Fixes

    • #8330 - take into account that static type may have been unwrapped in hasStaticInType() by @someniatko in https://github.com/vimeo/psalm/pull/8335
    • recognize @psalm-allow-private-mutation in PHP 8+ constructors by @someniatko in https://github.com/vimeo/psalm/pull/8341
    • ReflectionProperty::getValue $object is nullable since php 8.0 by @mathroc in https://github.com/vimeo/psalm/pull/8344
    • Fix formatCurrency return type by @VincentLanglet in https://github.com/vimeo/psalm/pull/8349

    Full Changelog: https://github.com/vimeo/psalm/compare/4.25.0...4.26.0

    Source code(tar.gz)
    Source code(zip)
    psalm.phar(11.47 MB)
    psalm.phar.asc(488 bytes)
  • v4.25.0(Jul 28, 2022)

    What's Changed

    Features

    • New "Count" Report Format by @jack-worman in https://github.com/vimeo/psalm/pull/8244
    • Adds support for fixing missing throws doc block by @aszenz in https://github.com/vimeo/psalm/pull/7994

    Fixes

    • Stop using deprecated string interpolation syntax in StatementsProvider.php by @TimWolla in https://github.com/vimeo/psalm/pull/8188
    • Fix return type of ReflectionNamedType::getName() by @BenMorel in https://github.com/vimeo/psalm/pull/8201
    • Fix several CallMap function signatures by @othercorey in https://github.com/vimeo/psalm/pull/8217
    • fix: ltrim may return class-string #8218 by @Tofandel in https://github.com/vimeo/psalm/pull/8219
    • use lock to fix race condition in cache by @kkmuffme in https://github.com/vimeo/psalm/pull/8240
    • Fix GEOSGeometry stubs with default values by @BenMorel in https://github.com/vimeo/psalm/pull/8214
    • Fix nullable return types for CallMap functions by @othercorey in https://github.com/vimeo/psalm/pull/8228
    • Improve inferring the "final" static type when calling static methods inside a different class by @someniatko in https://github.com/vimeo/psalm/pull/8249
    • fix triggerErrorExits not working by @kkmuffme in https://github.com/vimeo/psalm/pull/8304
    • Fixed ini_set types for arg value by @honca in https://github.com/vimeo/psalm/pull/8308
    • Add stub for DatePeriod by @fluffycondor in https://github.com/vimeo/psalm/pull/8312

    Internal changes

    • Various minor improvements to speed up by ~10% by @kkmuffme in https://github.com/vimeo/psalm/pull/8193
    • chore: Set permissions for GitHub actions by @naveensrinivasan in https://github.com/vimeo/psalm/pull/8189
    • chore: Included githubactions in the dependabot config by @naveensrinivasan in https://github.com/vimeo/psalm/pull/8203
    • build(deps): bump mheap/github-action-required-labels from 1 to 2 by @dependabot in https://github.com/vimeo/psalm/pull/8207
    • build(deps): bump fkirc/skip-duplicate-actions from 3.4.0 to 4.0.0 by @dependabot in https://github.com/vimeo/psalm/pull/8208
    • build(deps): bump actions/cache from 2 to 3 by @dependabot in https://github.com/vimeo/psalm/pull/8209
    • build(deps): bump actions/checkout from 2 to 3 by @dependabot in https://github.com/vimeo/psalm/pull/8210
    • Allow testing expected CallMap return types by @othercorey in https://github.com/vimeo/psalm/pull/8166
    • Fix codestyle errors in InternalCallMapHandlerTest by @othercorey in https://github.com/vimeo/psalm/pull/8220
    • use error_log instead of trigger_error by @kkmuffme in https://github.com/vimeo/psalm/pull/8243
    • fix race conditions causing notices if directory does not exist by @kkmuffme in https://github.com/vimeo/psalm/pull/8302

    New Contributors

    • @TimWolla made their first contribution in https://github.com/vimeo/psalm/pull/8188
    • @naveensrinivasan made their first contribution in https://github.com/vimeo/psalm/pull/8189
    • @dependabot made their first contribution in https://github.com/vimeo/psalm/pull/8207
    • @Tofandel made their first contribution in https://github.com/vimeo/psalm/pull/8219
    • @aszenz made their first contribution in https://github.com/vimeo/psalm/pull/7994
    • @someniatko made their first contribution in https://github.com/vimeo/psalm/pull/8249
    • @honca made their first contribution in https://github.com/vimeo/psalm/pull/8308

    Full Changelog: https://github.com/vimeo/psalm/compare/4.24.0...v4.25.0

    Source code(tar.gz)
    Source code(zip)
    psalm.phar(11.47 MB)
    psalm.phar.asc(488 bytes)
  • 4.24.0(Jun 27, 2022)

    What's Changed

    Features

    • Infer object shape when array or scalar is cast to object by @theodorejb in https://github.com/vimeo/psalm/pull/7935
    • Improve @return annotation for implode() so that it can handle non-empty-array of non-empty-strings case by @hirokinoue in https://github.com/vimeo/psalm/pull/7967
    • Bugfix/#7912 class APCuIterator does not exist by @KevinVanSonsbeek in https://github.com/vimeo/psalm/pull/7982
    • Improve @psalm-internal and prevent usage of IssueBuffer::add(). by @AndrolGenhald in https://github.com/vimeo/psalm/pull/8165
    • Encapsed literal strings by @AndrolGenhald in https://github.com/vimeo/psalm/pull/8164

    Fixes

    • fix missing is_a() parameter type by @staabm in https://github.com/vimeo/psalm/pull/7951
    • Improve array_unique callmap stubs by @mathroc in https://github.com/vimeo/psalm/pull/7981
    • Precise stat return type by @VincentLanglet in https://github.com/vimeo/psalm/pull/8032
    • Bugfix/splfileobject fputcsv invalidnamedargument by @KevinVanSonsbeek in https://github.com/vimeo/psalm/pull/8042
    • Fix TypeCombiner::combine to not modify TIntRange arguments. by @AndrolGenhald in https://github.com/vimeo/psalm/pull/8049
    • Coerce null to empty string in array keys by @weirdan in https://github.com/vimeo/psalm/pull/8064
    • Fix generic object comparison to use template constraint as default. by @AndrolGenhald in https://github.com/vimeo/psalm/pull/8069
    • Fix possibly empty array shape appearing non-empty (fixes #8048). by @AndrolGenhald in https://github.com/vimeo/psalm/pull/8051
    • fix #8099: ob_implicit_flush argument type changed to bool by @SamMousa in https://github.com/vimeo/psalm/pull/8100
    • number_format: allow third and forth parameters to be nullable by @drealecs in https://github.com/vimeo/psalm/pull/8114
    • Add ReflectionClass & ReflectionObject::isEnum() by @BenMorel in https://github.com/vimeo/psalm/pull/8117
    • Add missing ldap_unbind mapping for php 8.1 by @othercorey in https://github.com/vimeo/psalm/pull/8126
    • Fix signatures of ldap_* functions by @othercorey in https://github.com/vimeo/psalm/pull/8147
    • Fix datefmt_* function signatures by @othercorey in https://github.com/vimeo/psalm/pull/8153
    • Fix filter_var and filter_var_array signatures by @othercorey in https://github.com/vimeo/psalm/pull/8152
    • Fix array_* function signatures by @othercorey in https://github.com/vimeo/psalm/pull/8151
    • Add ReflectionProperty properties by @BenMorel in https://github.com/vimeo/psalm/pull/8148
    • Fix crash when redefining method with fewer params (fixes #8141). by @AndrolGenhald in https://github.com/vimeo/psalm/pull/8174

    Docs

    • fix small error in plugins_type_system.md by @mathroc in https://github.com/vimeo/psalm/pull/7914
    • Clarify in docs that zero is not considered a positive-int by @bdsl in https://github.com/vimeo/psalm/pull/8060

    Internal changes

    • Fix conflict of option -c with shell completion by @GromNaN in https://github.com/vimeo/psalm/pull/7988
    • change cache hash type for better performance by @kkmuffme in https://github.com/vimeo/psalm/pull/7997
    • micro-optimize condition by @kkmuffme in https://github.com/vimeo/psalm/pull/8009
    • igbinary_serialize code was missing in file by @kkmuffme in https://github.com/vimeo/psalm/pull/8007
    • Performance only load files once by @kkmuffme in https://github.com/vimeo/psalm/pull/8011
    • Fix syntax check failures by @weirdan in https://github.com/vimeo/psalm/pull/8028
    • Backport #7506 by @weirdan in https://github.com/vimeo/psalm/pull/8027
    • Run Shepherd with 8.0 by @weirdan in https://github.com/vimeo/psalm/pull/8029
    • Performance: cut the selected_text from snippet by @kkmuffme in https://github.com/vimeo/psalm/pull/8055
    • store origin location by ID to speed up psalm by up to 75% by @kkmuffme in https://github.com/vimeo/psalm/pull/8054
    • tests: add test that validates the callmap in the current runtime by @SamMousa in https://github.com/vimeo/psalm/pull/8104
    • Callmap validation ignore list cleanup by @SamMousa in https://github.com/vimeo/psalm/pull/8144

    Other changes

    • fix false positives for partially invalid phpdoc by @kkmuffme in https://github.com/vimeo/psalm/pull/8056

    New Contributors

    • @GromNaN made their first contribution in https://github.com/vimeo/psalm/pull/7988
    • @SamMousa made their first contribution in https://github.com/vimeo/psalm/pull/8100

    Full Changelog: https://github.com/vimeo/psalm/compare/4.23.0...4.24.0

    Source code(tar.gz)
    Source code(zip)
    psalm.phar(11.46 MB)
    psalm.phar.asc(488 bytes)
  • 4.23.0(May 2, 2022)

    What's Changed

    Features

    • Add configuration for maximum size of shaped array by @danog in https://github.com/vimeo/psalm/pull/7433
    • Disable filepath formatting as a link for Drone CI's output by @white43 in https://github.com/vimeo/psalm/pull/7861
    • cache statements even without persistent parser cache by @vognev in https://github.com/vimeo/psalm/pull/7876
    • Fix sort assert annotation by @hirokinoue in https://github.com/vimeo/psalm/pull/7908

    Fixes

    • Register openssl_sign function to impure functions by @samsonasik in https://github.com/vimeo/psalm/pull/7746
    • update phpredis stubs by @kkmuffme in https://github.com/vimeo/psalm/pull/7752
    • DateInterval::createFromDateString can be false by @Ne-Lexa in https://github.com/vimeo/psalm/pull/7758
    • Allow null to ArrayAccess::offsetSet $offset param by @franmomu in https://github.com/vimeo/psalm/pull/7759
    • Fix #7750: array_column type inference by @mtk3d in https://github.com/vimeo/psalm/pull/7760
    • Improve int range parsing by @fluffycondor in https://github.com/vimeo/psalm/pull/7775
    • Fix #3036: make argument $read of internal PHP function stream_socket nullable. by @niconoe- in https://github.com/vimeo/psalm/pull/7718
    • PDOStatement::fetchAll() has incorrect type by @hc-jworman in https://github.com/vimeo/psalm/pull/7785
    • More attribute fixes. by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7788
    • Avoid json_encode when serializing non-UTF8 literals by @ohader in https://github.com/vimeo/psalm/pull/7791
    • Add return shape for Throwable::getTrace by @ciaranmcnulty in https://github.com/vimeo/psalm/pull/7798
    • Fix ftp_fget/_fput/_nb_fget/_nb_fput stream arg type by @mrardon in https://github.com/vimeo/psalm/pull/7824
    • Fix namespaced min/max int range keyword issue introduced in #7775 by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7829
    • Psalm considers most readline functions as pure, but they have side effects by @mstilkerich in https://github.com/vimeo/psalm/pull/7828
    • Avoiding double spaces (v2) by @ThomasLandauer in https://github.com/vimeo/psalm/pull/7837
    • Fix Incompatible types found for T (Stub&ProxyQueryInterface is not in ProxyQueryInterface&Stub) by @VincentLanglet in https://github.com/vimeo/psalm/pull/7838
    • Further improve Throwable::getTrace() return type by @hirokinoue in https://github.com/vimeo/psalm/pull/7864
    • Fix openssl_csr_export() signature by @mpesari in https://github.com/vimeo/psalm/pull/7866
    • don't emit issues when doing arithmetics on float templates by @hirokinoue in https://github.com/vimeo/psalm/pull/7872
    • Fix return type of ldap_search by @paulfedorow in https://github.com/vimeo/psalm/pull/7894
    • Alter order of baseline option loading to permit updating custom baseline by @M1ke in https://github.com/vimeo/psalm/pull/7904
    • improve LSP by @ging-dev in https://github.com/vimeo/psalm/pull/7887

    Docs

    • Document @psalm-yield by @jrmajor in https://github.com/vimeo/psalm/pull/7849
    • Document @psalm-ignore-variable-* by @jrmajor in https://github.com/vimeo/psalm/pull/7851

    Internal changes

    • Fix disabling of appveyor auto build by @gndk in https://github.com/vimeo/psalm/pull/7801

    New Contributors

    • @Ne-Lexa made their first contribution in https://github.com/vimeo/psalm/pull/7758
    • @mtk3d made their first contribution in https://github.com/vimeo/psalm/pull/7760
    • @hc-jworman made their first contribution in https://github.com/vimeo/psalm/pull/7785
    • @gndk made their first contribution in https://github.com/vimeo/psalm/pull/7801
    • @mrardon made their first contribution in https://github.com/vimeo/psalm/pull/7824
    • @hirokinoue made their first contribution in https://github.com/vimeo/psalm/pull/7864
    • @white43 made their first contribution in https://github.com/vimeo/psalm/pull/7861
    • @vognev made their first contribution in https://github.com/vimeo/psalm/pull/7876
    • @paulfedorow made their first contribution in https://github.com/vimeo/psalm/pull/7894
    • @ging-dev made their first contribution in https://github.com/vimeo/psalm/pull/7887

    Full Changelog: https://github.com/vimeo/psalm/compare/4.22.0...4.23.0

    Source code(tar.gz)
    Source code(zip)
    psalm.phar(11.38 MB)
    psalm.phar.asc(488 bytes)
  • 5.0.0-beta1(May 13, 2022)

    What's Changed

    Removed

    • Finalize (and internalize) more classes by @weirdan in https://github.com/vimeo/psalm/pull/7578
    • Finalize issues by @weirdan in https://github.com/vimeo/psalm/pull/7595
    • Finalize storages by @weirdan in https://github.com/vimeo/psalm/pull/7597
    • Finalize virtual nodes by @weirdan in https://github.com/vimeo/psalm/pull/7598
    • Finalize types nodes by @weirdan in https://github.com/vimeo/psalm/pull/7623
    • remove totallyTyped by @orklah in https://github.com/vimeo/psalm/pull/7651

    Deprecations

    • deprecate totallyTyped by @orklah in https://github.com/vimeo/psalm/pull/7650

    Features

    • Resolve DIR / FILE when const/variable is used for include by @tomasz-kusy in https://github.com/vimeo/psalm/pull/7585
    • add ReflectionIntersectionType stub by @orklah in https://github.com/vimeo/psalm/pull/7621
    • Allow config to define thread count (4.x) by @M1ke in https://github.com/vimeo/psalm/pull/7633
    • add phpredis stubs by @kkmuffme in https://github.com/vimeo/psalm/pull/7614
    • Add configuration option to disable @var parsing everywhere except for properties. by @danog in https://github.com/vimeo/psalm/pull/7434
    • More class const improvements. by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7666
    • Add @psalm-check-type and @psalm-check-type-exact. by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7686
    • feat(types): add properties-of type by @Patrick-Remy in https://github.com/vimeo/psalm/pull/7359
    • Invert meaning of dupe_key by @danog in https://github.com/vimeo/psalm/pull/7475

    Fixes

    • fix wrong detection of purity by @orklah in https://github.com/vimeo/psalm/pull/7545
    • Fix object constant inference by @klimick in https://github.com/vimeo/psalm/pull/7542
    • Handle first class callable on unknown functions by @orklah in https://github.com/vimeo/psalm/pull/7546
    • Revert "PHP 8.1: Report missing typehints in overridden native methods" by @weirdan in https://github.com/vimeo/psalm/pull/7539
    • Ensure trait_exists() always returns bool by @Ocramius in https://github.com/vimeo/psalm/pull/7554
    • sealed keyed arrays by @orklah in https://github.com/vimeo/psalm/pull/7558
    • AtomicStaticCallAnalyzer: clear tmp var from context by @vincent4vx in https://github.com/vimeo/psalm/pull/7561
    • improving error message for Could not resolve config path by @phptest2 in https://github.com/vimeo/psalm/pull/7573
    • Fix crash when assigning reference to unknown array offset by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7583
    • Strip colours from success message by @weirdan in https://github.com/vimeo/psalm/pull/7620
    • Fix #6683 by improving simplification of CNF by @muglug in https://github.com/vimeo/psalm/pull/7631
    • Honour global function suppressions for UndefinedFunction by @weirdan in https://github.com/vimeo/psalm/pull/7657
    • Update return type for mysqli::connect_error by @morozov in https://github.com/vimeo/psalm/pull/7660
    • Correct name of ErrorException::__construct $line param by @chloekek in https://github.com/vimeo/psalm/pull/7659
    • Enum collapsing by @orklah in https://github.com/vimeo/psalm/pull/7655
    • Enum assertions by @orklah in https://github.com/vimeo/psalm/pull/7662
    • Consistency for empty reconciliations by @orklah in https://github.com/vimeo/psalm/pull/7663
    • Fix false positive for unused variable in try (fixes #7613). by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7664
    • fix count with match on arrays by @orklah in https://github.com/vimeo/psalm/pull/7665
    • Prevent unnecessary filter_var() warnings on primitive types by @mmcev106 in https://github.com/vimeo/psalm/pull/7677
    • Throw exception if file_put_contents failed by @dmitryuk in https://github.com/vimeo/psalm/pull/7690
    • Improve bool to int casting. by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7696
    • Fix issues with int range unpacking and with min/max by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7699
    • Analyze attribute statements instead of constructing virtual statements. by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7692
    • Fix some minor issues with references. by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7684
    • Config threads: add to config.xsd by @M1ke in https://github.com/vimeo/psalm/pull/7708
    • Use current context when analyzing attributes by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7713
    • Fix first-class callable in loop by @trowski in https://github.com/vimeo/psalm/pull/7715
    • Support for properties in interfaces extending \UnitEnum & \BackedEnum by @whatUwant in https://github.com/vimeo/psalm/pull/7719
    • PDOException extends RuntimeException and can use int code errors by @VincentLanglet in https://github.com/vimeo/psalm/pull/7673
    • allow SimpleTypeInferer to infer non empty lists by @orklah in https://github.com/vimeo/psalm/pull/7732
    • Attribute analysis improvements by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7727
    • restore callable-string Id by @orklah in https://github.com/vimeo/psalm/pull/7787
    • fix refining lowercase string and non-empty-string together by @orklah in https://github.com/vimeo/psalm/pull/7844
    • Remove @psalm-generator-return annotation by @jrmajor in https://github.com/vimeo/psalm/pull/7853
    • Resolve #7855 remove false from return type, in php8.0 and further ve… by @dkemper in https://github.com/vimeo/psalm/pull/7859

    Docs

    • doc about property initialization by @orklah in https://github.com/vimeo/psalm/pull/7593
    • Fix issue documentation links. by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7687
    • Improve documentation for InvalidGlobal to explain that it's sometimes valid by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7693
    • Fix int-mask-of doc example by @Seldaek in https://github.com/vimeo/psalm/pull/7812
    • Documented the allowMissingFiles attribute for ignoreFiles by @mmcev106 in https://github.com/vimeo/psalm/pull/7867

    Internal changes

    • Fix extension capitalization issue, add extensions to version message. by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7574
    • Added backward compatibility check by @weirdan in https://github.com/vimeo/psalm/pull/7576
    • Allow mocking final classes by @weirdan in https://github.com/vimeo/psalm/pull/7591
    • Fixed composer branch-alias by @sasezaki in https://github.com/vimeo/psalm/pull/7594
    • No longer require declare reflection-docblock:^5 as dependency by @sasezaki in https://github.com/vimeo/psalm/pull/7612
    • Bump up phpunit,prophecy, and introduced phpspec/prophecy-phpunit by @sasezaki in https://github.com/vimeo/psalm/pull/7617
    • consistency in AssertionFinder by @orklah in https://github.com/vimeo/psalm/pull/7622
    • skip a test because we removed the feature for now by @orklah in https://github.com/vimeo/psalm/pull/7642
    • Adjust for composer-require-checker check. by @sasezaki in https://github.com/vimeo/psalm/pull/7632
    • Removed .scrutinizer.yml by @sasezaki in https://github.com/vimeo/psalm/pull/7652
    • Use array_fill_keys() by @weirdan in https://github.com/vimeo/psalm/pull/7661
    • Fixed PSR-4 warnings by @weirdan in https://github.com/vimeo/psalm/pull/7683
    • chore: enable psl tests again by @azjezz in https://github.com/vimeo/psalm/pull/7596
    • Make callbacks marked as static by @SCIF in https://github.com/vimeo/psalm/pull/6695

    New Contributors

    • @phptest2 made their first contribution in https://github.com/vimeo/psalm/pull/7573
    • @tomasz-kusy made their first contribution in https://github.com/vimeo/psalm/pull/7585
    • @chloekek made their first contribution in https://github.com/vimeo/psalm/pull/7659
    • @dmitryuk made their first contribution in https://github.com/vimeo/psalm/pull/7690
    • @whatUwant made their first contribution in https://github.com/vimeo/psalm/pull/7719
    • @Seldaek made their first contribution in https://github.com/vimeo/psalm/pull/7812
    • @dkemper made their first contribution in https://github.com/vimeo/psalm/pull/7859

    Full Changelog: https://github.com/vimeo/psalm/compare/5.0.0-alpha1...5.0.0-beta1

    Source code(tar.gz)
    Source code(zip)
    psalm.phar(11.53 MB)
    psalm.phar.asc(488 bytes)
  • 4.22.0(Feb 27, 2022)

    What's Changed

    Fixes

    • Analyze attribute statements instead of constructing virtual statements. by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7692
    • Config threads: add to config.xsd by @M1ke in https://github.com/vimeo/psalm/pull/7708
    • Use current context when analyzing attributes by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7713
    • Fix first-class callable in loop by @trowski in https://github.com/vimeo/psalm/pull/7715
    • Support for properties in interfaces extending \UnitEnum & \BackedEnum by @whatUwant in https://github.com/vimeo/psalm/pull/7719
    • PDOException extends RuntimeException and can use int code errors by @VincentLanglet in https://github.com/vimeo/psalm/pull/7673
    • allow SimpleTypeInferer to infer non empty lists by @orklah in https://github.com/vimeo/psalm/pull/7732
    • Attribute analysis improvements by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7727

    New Contributors

    • @whatUwant made their first contribution in https://github.com/vimeo/psalm/pull/7719

    Full Changelog: https://github.com/vimeo/psalm/compare/4.21.0...4.22.0

    Source code(tar.gz)
    Source code(zip)
    psalm.phar(11.23 MB)
    psalm.phar.asc(488 bytes)
  • 4.21.0(Feb 20, 2022)

    What's Changed

    Deprecations

    • deprecate totallyTyped by @orklah in https://github.com/vimeo/psalm/pull/7650

    Features

    • Resolve DIR / FILE when const/variable is used for include by @tomasz-kusy in https://github.com/vimeo/psalm/pull/7585
    • add ReflectionIntersectionType stub by @orklah in https://github.com/vimeo/psalm/pull/7621
    • Allow config to define thread count (4.x) by @M1ke in https://github.com/vimeo/psalm/pull/7633
    • add phpredis stubs by @kkmuffme in https://github.com/vimeo/psalm/pull/7614
    • Add configuration option to disable @var parsing everywhere except for properties. by @danog in https://github.com/vimeo/psalm/pull/7434

    Fixes

    • Strip colours from success message by @weirdan in https://github.com/vimeo/psalm/pull/7620
    • Honour global function suppressions for UndefinedFunction by @weirdan in https://github.com/vimeo/psalm/pull/7657
    • Update return type for mysqli::connect_error by @morozov in https://github.com/vimeo/psalm/pull/7660
    • Correct name of ErrorException::__construct $line param by @chloekek in https://github.com/vimeo/psalm/pull/7659
    • Fix false positive for unused variable in try (fixes #7613). by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7664
    • Throw exception if file_put_contents failed by @dmitryuk in https://github.com/vimeo/psalm/pull/7690

    New Contributors

    • @tomasz-kusy made their first contribution in https://github.com/vimeo/psalm/pull/7585
    • @kkmuffme made their first contribution in https://github.com/vimeo/psalm/pull/7614
    • @chloekek made their first contribution in https://github.com/vimeo/psalm/pull/7659
    • @dmitryuk made their first contribution in https://github.com/vimeo/psalm/pull/7690

    Full Changelog: https://github.com/vimeo/psalm/compare/4.20.0...4.21.0

    Source code(tar.gz)
    Source code(zip)
    psalm.phar(11.22 MB)
    psalm.phar.asc(488 bytes)
  • 4.20.0(Feb 3, 2022)

    What's Changed

    Deprecations

    • [TASK] Add AfterFunctionLikeAnalysisEvent::getFunctionlikeStorage by @ohader in https://github.com/vimeo/psalm/pull/7532

    Fixes

    • Fix for Exception->getCode return type provider by @VincentLanglet in https://github.com/vimeo/psalm/pull/7525
    • fix wrong detection of purity by @orklah in https://github.com/vimeo/psalm/pull/7545
    • Fix object constant inference by @klimick in https://github.com/vimeo/psalm/pull/7542
    • Handle first class callable on unknown functions by @orklah in https://github.com/vimeo/psalm/pull/7546
    • Revert "PHP 8.1: Report missing typehints in overridden native methods" by @weirdan in https://github.com/vimeo/psalm/pull/7539
    • Ensure trait_exists() always returns bool by @Ocramius in https://github.com/vimeo/psalm/pull/7554
    • sealed keyed arrays by @orklah in https://github.com/vimeo/psalm/pull/7558
    • AtomicStaticCallAnalyzer: clear tmp var from context by @vincent4vx in https://github.com/vimeo/psalm/pull/7561
    • improving error message for Could not resolve config path by @phptest2 in https://github.com/vimeo/psalm/pull/7573

    Internal changes

    • Update .gitattributes by @weirdan in https://github.com/vimeo/psalm/pull/7522

    New Contributors

    • @phptest2 made their first contribution in https://github.com/vimeo/psalm/pull/7573

    Full Changelog: https://github.com/vimeo/psalm/compare/4.19.0...v4.20.0

    Source code(tar.gz)
    Source code(zip)
    psalm.phar(11.20 MB)
    psalm.phar.asc(488 bytes)
  • 5.0.0-alpha1(Feb 3, 2022)

    What's Changed

    Removed

    • Php version consistency by @orklah in https://github.com/vimeo/psalm/pull/6898
    • Removed TEmpty by @orklah in https://github.com/vimeo/psalm/pull/6662
    • remove support for allowPhpstormGenerics by @orklah in https://github.com/vimeo/psalm/pull/6705
    • remove exitFunctions for Psalm5 by @orklah in https://github.com/vimeo/psalm/pull/6808
    • Drop legacy procedural files by @weirdan in https://github.com/vimeo/psalm/pull/7270
    • Dropped removed config entries by @weirdan in https://github.com/vimeo/psalm/pull/7272
    • Dropped legacy plugin API by @weirdan in https://github.com/vimeo/psalm/pull/7275
    • Dropped deprecated CodeIssue methods by @weirdan in https://github.com/vimeo/psalm/pull/7276
    • Dropped deprecated DocComment methods by @weirdan in https://github.com/vimeo/psalm/pull/7278
    • Dropped THtmlEscapedString by @weirdan in https://github.com/vimeo/psalm/pull/7285
    • Drop orphaned token by @weirdan in https://github.com/vimeo/psalm/pull/7290
    • Bump PHP version to 7.4 by @weirdan in https://github.com/vimeo/psalm/pull/7291
    • Remove forbidEcho by @orklah in https://github.com/vimeo/psalm/pull/7420
    • remove TPositiveInt by @orklah in https://github.com/vimeo/psalm/pull/7473
    • Lock event classes by @weirdan in https://github.com/vimeo/psalm/pull/7491
    • [TASK] Add AfterFunctionLikeAnalysisEvent::getFunctionlikeStorage by @ohader in https://github.com/vimeo/psalm/pull/7526

    Deprecations

    • [TASK] Add AfterFunctionLikeAnalysisEvent::getFunctionlikeStorage by @ohader in https://github.com/vimeo/psalm/pull/7532

    Features

    • Support PHPStan notation for empty-arrays by @orklah in https://github.com/vimeo/psalm/pull/7312
    • Try to provide literal int types when possible (fixes #6966) by @ricardoboss in https://github.com/vimeo/psalm/pull/7071
    • Allow config to define thread count by @M1ke in https://github.com/vimeo/psalm/pull/7442
    • Contextual type inference for high order function arg by @klimick in https://github.com/vimeo/psalm/pull/7417
    • feat: Handle native intersection types by @petewalker in https://github.com/vimeo/psalm/pull/7454
    • improve support for enum_exists by @orklah in https://github.com/vimeo/psalm/pull/7404
    • Support type annotations for class consts (fixes #942). by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7123
    • Improve class constant static analysis by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7154
    • Add support for references and improve UnusedVariable checks (fixes #7254). by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7339
    • InternalTaintSinkMap: Add getimagesize as SSRF sink by @mal-tee in https://github.com/vimeo/psalm/pull/7504
    • Enable extensions based on composer.json instead of those loaded at runtime (fixes #5482). by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7107
    • Dynamic function storage provider by @klimick in https://github.com/vimeo/psalm/pull/7471
    • ❗Allow plugins to modify Config::$fileExtensions early by @ohader in https://github.com/vimeo/psalm/pull/6789
    • [FEATURE] Introduce BeforeStatementAnalysisEvent by @ohader in https://github.com/vimeo/psalm/pull/7535
    • [FEATURE] Allow to intercept adding issue in IssueBuffer by @ohader in https://github.com/vimeo/psalm/pull/7530
    • Ensure all template parameters are specified in all extended|used classlikes by @danog in https://github.com/vimeo/psalm/pull/7492
    • feat: make key-of/value-of usable with non-const arrays by @Patrick-Remy in https://github.com/vimeo/psalm/pull/7396

    Fixes

    • Use InvalidScalarArgument only when we can be sure PHP attempts coercion by @muglug in https://github.com/vimeo/psalm/pull/7188
    • Trim baseline selection by @weirdan in https://github.com/vimeo/psalm/pull/7279
    • Prevent NoValue when there is no phpdoc by @orklah in https://github.com/vimeo/psalm/pull/7399
    • create a return type provider for mb_internal_encoding by @orklah in https://github.com/vimeo/psalm/pull/7437
    • Array key exists assert both ways by @orklah in https://github.com/vimeo/psalm/pull/7449
    • [TypeProvider] Provide argument types during FunctionParamsProviderEvent by @veewee in https://github.com/vimeo/psalm/pull/7394
    • Fix stub parent class not loaded. by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7110
    • fix code where the offset was wrong by @orklah in https://github.com/vimeo/psalm/pull/7463
    • reconcile two arrays by intersecting them by @orklah in https://github.com/vimeo/psalm/pull/7470
    • fix error with 0 being considered positive by @orklah in https://github.com/vimeo/psalm/pull/7487
    • Fix crash due to unresolvable constant. by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7490
    • Fix failing case for const analyzer. by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7503
    • Fix side effect when loading config by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7506
    • improve literal inequality with ranges and rework GreaterThan/LessThan assertions by @orklah in https://github.com/vimeo/psalm/pull/7511
    • Remove mic-drop hack from if analysis by @muglug in https://github.com/vimeo/psalm/pull/7484
    • fix some iterator stubs by @orklah in https://github.com/vimeo/psalm/pull/6970
    • Fix for Exception->getCode return type provider by @VincentLanglet in https://github.com/vimeo/psalm/pull/7525
    • Fix empty array by @orklah in https://github.com/vimeo/psalm/pull/7517
    • add back empty keyword by @orklah in https://github.com/vimeo/psalm/pull/7533

    Docs

    • Dropped html-escaped-string docs by @weirdan in https://github.com/vimeo/psalm/pull/7281
    • Document BC breaks in #7358 by @weirdan in https://github.com/vimeo/psalm/pull/7360
    • Added documentation for baseline files by @ricardoboss in https://github.com/vimeo/psalm/pull/7429
    • Fix documentation for config. by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7564
    • Fix bullet indentation in documentation by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7565

    Internal changes

    • Disable PSL (not yet compatible with Psalm 5) by @weirdan in https://github.com/vimeo/psalm/pull/7269
    • Require @internal annotation on Psalm\Internal symbols by @weirdan in https://github.com/vimeo/psalm/pull/7268
    • Dropped deprecated TypeAnalyzer methods by @weirdan in https://github.com/vimeo/psalm/pull/7277
    • Moved getPsalmHelpText() to Cli\Psalm by @weirdan in https://github.com/vimeo/psalm/pull/7280
    • Replaced deprecated webmozart/path-util by @weirdan in https://github.com/vimeo/psalm/pull/7292
    • Indent heredoc by @weirdan in https://github.com/vimeo/psalm/pull/7294
    • Dropped dead code based on PHP_VERSION_ID by @weirdan in https://github.com/vimeo/psalm/pull/7300
    • Apply literal number separator rector by @weirdan in https://github.com/vimeo/psalm/pull/7299
    • Applied NullCoalescingOperatorRector by @weirdan in https://github.com/vimeo/psalm/pull/7302
    • Applied JsonThrowOnErrorRector by @weirdan in https://github.com/vimeo/psalm/pull/7303
    • Applied ListToArrayDestructRector by @weirdan in https://github.com/vimeo/psalm/pull/7310
    • replace array<never, never> as a way to detect empty arrays by a dedicated method by @orklah in https://github.com/vimeo/psalm/pull/7313
    • Applied ClosureToArrowFunctionRector by @weirdan in https://github.com/vimeo/psalm/pull/7315
    • Simplify object comparison by @muglug in https://github.com/vimeo/psalm/pull/7340
    • Rename was_static property to is_static to be more accurate by @muglug in https://github.com/vimeo/psalm/pull/7358
    • Add explicit resolveSymlinks option for project directories by @dvz in https://github.com/vimeo/psalm/pull/7163
    • Ensure that all entries in test arrays have explicit keys by @muglug in https://github.com/vimeo/psalm/pull/7386
    • TCallableString is non-falsy (0 can't be a functionlike name) by @orklah in https://github.com/vimeo/psalm/pull/6521
    • fix tests by @orklah in https://github.com/vimeo/psalm/pull/7446
    • Use objects, not strings, for assertions by @muglug in https://github.com/vimeo/psalm/pull/7410
    • Nitpicks by @orklah in https://github.com/vimeo/psalm/pull/7448
    • refactor description of types in Atomic by @orklah in https://github.com/vimeo/psalm/pull/7409
    • remove TPositiveInt usage for TIntRange by @orklah in https://github.com/vimeo/psalm/pull/7472
    • Update .gitattributes by @weirdan in https://github.com/vimeo/psalm/pull/7522
    • Fix ExceptionCodeTest provider shape by @weirdan in https://github.com/vimeo/psalm/pull/7538

    New Contributors

    • @M1ke made their first contribution in https://github.com/vimeo/psalm/pull/7442
    • @petewalker made their first contribution in https://github.com/vimeo/psalm/pull/7454
    • @mal-tee made their first contribution in https://github.com/vimeo/psalm/pull/7504

    Full Changelog: https://github.com/vimeo/psalm/compare/4.19.0...5.0.0-alpha1

    Source code(tar.gz)
    Source code(zip)
    psalm.phar(11.28 MB)
    psalm.phar.asc(488 bytes)
  • 4.19.0(Jan 28, 2022)

    What's Changed

    Deprecations

    • deprecate forbidEcho by @orklah in https://github.com/vimeo/psalm/pull/6902
    • Mark loadXdebugStub as deprecated (removed in #7107). by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7466
    • deprecate TPositiveInt by @orklah in https://github.com/vimeo/psalm/pull/7474
    • Deprecate template_extended_count by @danog in https://github.com/vimeo/psalm/pull/7494

    Features

    • Errors on superior/inferior reconciliation by @orklah in https://github.com/vimeo/psalm/pull/7335
    • PHP 8.2: seal all properties configuration by @danog in https://github.com/vimeo/psalm/pull/7242
    • Add support of template for docblock methods by @vincent4vx in https://github.com/vimeo/psalm/pull/7385
    • Resolve generics of inherited pseudo methods by @vincent4vx in https://github.com/vimeo/psalm/pull/7430
    • PHP 8.1: Report missing typehints in overridden native methods by @danog in https://github.com/vimeo/psalm/pull/7363
    • Add configuration option to disable @psalm-suppress all by @danog in https://github.com/vimeo/psalm/pull/7431
    • Add support of docblock method using parent keyword by @vincent4vx in https://github.com/vimeo/psalm/pull/7414

    Fixes

    • Do not throw exception on xinclude with fallbacks by @vstm in https://github.com/vimeo/psalm/pull/7324
    • Update return type of iterator_count and iterator_apply functions to 0|positive-int by @ricardoboss in https://github.com/vimeo/psalm/pull/7331
    • replace class name by full FQN for scoper by @orklah in https://github.com/vimeo/psalm/pull/7337
    • Seal the array inferred for hrtime by @orklah in https://github.com/vimeo/psalm/pull/7349
    • set the is_list flag for the array inferred for hrtime by @orklah in https://github.com/vimeo/psalm/pull/7350
    • Fix dir Callmap by @VincentLanglet in https://github.com/vimeo/psalm/pull/7347
    • refactor the TooFewArguments check to start checking with named arguments by @orklah in https://github.com/vimeo/psalm/pull/7348
    • allow short closure to return never by @orklah in https://github.com/vimeo/psalm/pull/7326
    • keep class-strings through array_merge by @orklah in https://github.com/vimeo/psalm/pull/7356
    • fix: pass static class name to ReturnTypeAnalyzer by @Patrick-Remy in https://github.com/vimeo/psalm/pull/7366
    • Support multiple elements by @wouterj in https://github.com/vimeo/psalm/pull/7354
    • Fix closure to have storage bug in codeAction by @tm1000 in https://github.com/vimeo/psalm/pull/7368
    • Refactor Reconciler::handleLiteralEquality by @orklah in https://github.com/vimeo/psalm/pull/7304
    • Handle inherited docblock method by @vincent4vx in https://github.com/vimeo/psalm/pull/7391
    • Catch additional InvalidArgumentException by @tm1000 in https://github.com/vimeo/psalm/pull/7384
    • Combine positive int and range by @orklah in https://github.com/vimeo/psalm/pull/7400
    • Psalm can't be sure get_object_vars will return an empty array unless object is known AND final by @orklah in https://github.com/vimeo/psalm/pull/7401
    • support @readonly for promoted properties by @orklah in https://github.com/vimeo/psalm/pull/7403
    • Fix self parsing for psalm-if-this-is and psalm-self-out by @klimick in https://github.com/vimeo/psalm/pull/7405
    • Improve signature of random_bytes() by @villfa in https://github.com/vimeo/psalm/pull/7406
    • Improve signature of DOMDocument::loadXML() by @villfa in https://github.com/vimeo/psalm/pull/7407
    • Fix kafka stubs by @danog in https://github.com/vimeo/psalm/pull/7426
    • Fix Incomplete return type for mb_split() function by @RishiKumarRay in https://github.com/vimeo/psalm/pull/7432
    • fix proc_open stub for php >= 8.0 by @brainlock in https://github.com/vimeo/psalm/pull/7443
    • change nullable for array signature to be equal to param signature by @swiffer in https://github.com/vimeo/psalm/pull/7301
    • handle two more cases of firstClassCallable by @orklah in https://github.com/vimeo/psalm/pull/7460
    • fix internal properties on interfaces by @orklah in https://github.com/vimeo/psalm/pull/7467
    • Add Exception->getCode() return type provider by @VincentLanglet in https://github.com/vimeo/psalm/pull/7390
    • Fix array_replace type by @ElisDN in https://github.com/vimeo/psalm/pull/7483
    • Add missing parameter to Phar::getMetadata() by @villfa in https://github.com/vimeo/psalm/pull/7486
    • Bugfix/#6151 typedoesnotcontainnull on return value from dom import simplexml by @KevinVanSonsbeek in https://github.com/vimeo/psalm/pull/7489
    • BugFix: Made DOMNode::nodeValue nullable by @KevinVanSonsbeek in https://github.com/vimeo/psalm/pull/7501

    Docs

    • Fix typo in documentation filename by @danog in https://github.com/vimeo/psalm/pull/7373

    Internal changes

    • replace empty checks on Union with dedicated method by @orklah in https://github.com/vimeo/psalm/pull/7336
    • Fix faulty Config tests by @wouterj in https://github.com/vimeo/psalm/pull/7355
    • Fix @covers annotation. by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7374
    • Add test for issues.md to ensure all documented issues are listed. by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7383
    • remove psl analysis from CI by @orklah in https://github.com/vimeo/psalm/pull/7397
    • use Reconciler::RECONCILIATION_* by @orklah in https://github.com/vimeo/psalm/pull/7398
    • drop phpunit compatibility aliases by @orklah in https://github.com/vimeo/psalm/pull/7435

    Other changes

    • !!! Deprecate \Psalm\Plugin\RegistrationInterface methods by @ohader in https://github.com/vimeo/psalm/pull/7455

    New Contributors

    • @Patrick-Remy made their first contribution in https://github.com/vimeo/psalm/pull/7366
    • @vincent4vx made their first contribution in https://github.com/vimeo/psalm/pull/7391
    • @RishiKumarRay made their first contribution in https://github.com/vimeo/psalm/pull/7432
    • @KevinVanSonsbeek made their first contribution in https://github.com/vimeo/psalm/pull/7489

    Full Changelog: https://github.com/vimeo/psalm/compare/4.18.1...4.19.0

    Source code(tar.gz)
    Source code(zip)
    psalm.phar(11.20 MB)
    psalm.phar.asc(488 bytes)
  • 4.18.1(Jan 8, 2022)

  • 4.18(Jan 7, 2022)

    Compatibility

    Psalm now required Composer 2.

    What's Changed

    Deprecations

    • Deprecated Codebase::$php_major_version and Codebase::$php_minor_version properties by @weirdan in https://github.com/vimeo/psalm/pull/7265
    • Deprecated THtmlEscapedString by @weirdan in https://github.com/vimeo/psalm/pull/7284

    Features

    • Template and variable types inference for methods marked with psalm-if-this-is by @klimick in https://github.com/vimeo/psalm/pull/7259
    • [Feat]: Initial Support for LSP Code Actions by @tm1000 in https://github.com/vimeo/psalm/pull/7255
    • Allow assertions on mutable object properties. by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7252
    • Disallow ksorting lists by @danog in https://github.com/vimeo/psalm/pull/7019

    Fixes

    • Remove "is not in project" warnings by @tm1000 in https://github.com/vimeo/psalm/pull/7256
    • Report missing file path properly by @simPod in https://github.com/vimeo/psalm/pull/7266
    • uniqid() returns a non-empty-string by @MidnightDesign in https://github.com/vimeo/psalm/pull/7271
    • pdo: more precise generic type by @staabm in https://github.com/vimeo/psalm/pull/7274
    • resolve ClassConstant for both sides in isContainedBy by @orklah in https://github.com/vimeo/psalm/pull/7286
    • Identify ints from TClassConstant when checking for LiteralEquality by @orklah in https://github.com/vimeo/psalm/pull/7287
    • resolve type alias and class const on UnionTypeComparator by @orklah in https://github.com/vimeo/psalm/pull/7288
    • Fix parse_url() return type by @villfa in https://github.com/vimeo/psalm/pull/7293
    • don't crash when pushing a template to in_array by @orklah in https://github.com/vimeo/psalm/pull/7311
    • Made all reflection classes implement Reflector by @donquixote in https://github.com/vimeo/psalm/pull/7317
    • fix empty string not quoted in keyed array offset by @orklah in https://github.com/vimeo/psalm/pull/7309
    • Prevented crashes on array_map(...) by @weirdan in https://github.com/vimeo/psalm/pull/7321
    • Fix analysis when __invoke() exists by @villfa in https://github.com/vimeo/psalm/pull/7325

    Internal changes

    • Increase composer timeout by @weirdan in https://github.com/vimeo/psalm/pull/7264
    • Move from deprecated Composer 1 to Composer 2 runtime api by @DeyV in https://github.com/vimeo/psalm/pull/7239

    New Contributors

    • @DeyV made their first contribution in https://github.com/vimeo/psalm/pull/7239
    • @MidnightDesign made their first contribution in https://github.com/vimeo/psalm/pull/7271
    • @donquixote made their first contribution in https://github.com/vimeo/psalm/pull/7317

    Full Changelog: https://github.com/vimeo/psalm/compare/4.17.0...4.18

    Source code(tar.gz)
    Source code(zip)
    psalm.phar(11.13 MB)
    psalm.phar.asc(488 bytes)
  • 4.17.0(Jan 1, 2022)

    What's Changed

    Features

    • Fix first-class callables with built-in, magic, undefined methods and callable expressions by @trowski in https://github.com/vimeo/psalm/pull/7232

    Fixes

    • quote more chars in keyed array names by @orklah in https://github.com/vimeo/psalm/pull/7225
    • handle literal equality with integer ranges by @orklah in https://github.com/vimeo/psalm/pull/7224
    • Allow XdebugHandler version 3 by @johnstevenson in https://github.com/vimeo/psalm/pull/7211
    • Improve CliUtils $argv handling by @vstm in https://github.com/vimeo/psalm/pull/7210
    • Fix closure param type inference in generic context by @klimick in https://github.com/vimeo/psalm/pull/7200
    • Fix @psalm-internal with trailing whitespaces by @sj-i in https://github.com/vimeo/psalm/pull/7207
    • add missing samesite array attribute by @swiffer in https://github.com/vimeo/psalm/pull/7215
    • Contextual inference for closure param types by @klimick in https://github.com/vimeo/psalm/pull/7228
    • allow suppressing unevaluatedCode by @orklah in https://github.com/vimeo/psalm/pull/7236
    • mysqli_fetch_object: added missing generic by @staabm in https://github.com/vimeo/psalm/pull/7240
    • Checking psalm-if-this-is before applying psalm-this-out by @klimick in https://github.com/vimeo/psalm/pull/7251
    • allow calling mutation_free function inside a mutation_free context by @orklah in https://github.com/vimeo/psalm/pull/7253
    • Fixes #7246, wrap getTypeContextAtPosition in try/catch by @tm1000 in https://github.com/vimeo/psalm/pull/7247
    • forbid calling impure callable in immutable context by @orklah in https://github.com/vimeo/psalm/pull/7260
    • revert #7054 by @orklah in https://github.com/vimeo/psalm/pull/7263

    Internal changes

    • remove always true/false conditions by @orklah in https://github.com/vimeo/psalm/pull/7229
    • code grooming by @orklah in https://github.com/vimeo/psalm/pull/7230
    • more code grooming by @orklah in https://github.com/vimeo/psalm/pull/7233
    • Speed up Windows tests by @weirdan in https://github.com/vimeo/psalm/pull/7245
    • Improve negated reconciliation logic by @muglug in https://github.com/vimeo/psalm/pull/7261

    New Contributors

    • @johnstevenson made their first contribution in https://github.com/vimeo/psalm/pull/7211
    • @vstm made their first contribution in https://github.com/vimeo/psalm/pull/7210
    • @swiffer made their first contribution in https://github.com/vimeo/psalm/pull/7215

    Full Changelog: https://github.com/vimeo/psalm/compare/4.16.1...4.17.0

    Source code(tar.gz)
    Source code(zip)
    psalm.phar(11.14 MB)
    psalm.phar.asc(488 bytes)
  • 4.16.1(Dec 26, 2021)

  • 4.16.0(Dec 26, 2021)

    What's Changed

    Removed

    • Codebase::$use_referencing_files, Context::$possible_param_types and FunctionLikeStorage::$template_covariants were removed. We do not believe they were used by anyone, thus we don't consider it to be a BC break

    Features

    • Detect unused properties that are written to inside arrays by @muglug in https://github.com/vimeo/psalm/pull/7129
    • Allow operator overloading for Decimal extension (fixes #3938). by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7103
    • Fix count_chars stubs by @kamil-tekiela in https://github.com/vimeo/psalm/pull/7094
    • Added support for first-class callables by @trowski in https://github.com/vimeo/psalm/pull/7113
    • Allow suppressing UnusedPsalmSuppress, remove unused suppressions. by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7133
    • Forbid positional arg after named arg by @klimick in https://github.com/vimeo/psalm/pull/7136
    • in_array returns false in strict mode if types are incompatibles by @mathroc in https://github.com/vimeo/psalm/pull/7141
    • "No errors found!" message is now printed within a nice green block by @SMAtaurRahman in https://github.com/vimeo/psalm/pull/7150
    • Use igbinary for communication between processes if possible by @sj-i in https://github.com/vimeo/psalm/pull/7162
    • Add Set::map() to ext-ds stub by @simPod in https://github.com/vimeo/psalm/pull/7156
    • Improve project files discovery performance by @dvz in https://github.com/vimeo/psalm/pull/7161
    • allow marking enum cases as deprecated by @pilif in https://github.com/vimeo/psalm/pull/7192

    Fixes

    • Fix non-empty-literal-string to behave as subtype of non-empty-string (fixes #7095). by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7105
    • fix reconciliation between positive-int and inferior/superior assertions by @orklah in https://github.com/vimeo/psalm/pull/7106
    • don't stop analyzing array, even if we already have a type and we can't create an object like by @orklah in https://github.com/vimeo/psalm/pull/7093
    • fix missing case for displaying varId by @orklah in https://github.com/vimeo/psalm/pull/7054
    • array_count_values return type for uncertain arrays by @weirdan in https://github.com/vimeo/psalm/pull/7115
    • Class property issue suppression fixes. by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7130
    • Fix type inference of closure params by @klimick in https://github.com/vimeo/psalm/pull/7135
    • Fix closure param type inference with named params by @klimick in https://github.com/vimeo/psalm/pull/7139
    • Post-assertions in loops by @klimick in https://github.com/vimeo/psalm/pull/7143
    • fix CI by @orklah in https://github.com/vimeo/psalm/pull/7153
    • Fix optional arguments in number_format (fixes #7158). by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7159
    • Fix ldap_set_rebind_proc signature by @villfa in https://github.com/vimeo/psalm/pull/7145
    • Fixed compatibility with SoapClient by @yethee in https://github.com/vimeo/psalm/pull/7140
    • display class-strings in keyed arrays syntax and allow using them for assertions by @orklah in https://github.com/vimeo/psalm/pull/7152
    • ISSUE-5962 Fixed wrong line number for @method annotations by @nowaja in https://github.com/vimeo/psalm/pull/7157
    • Fix conflicting array_map return provider fake variables. by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7167
    • Fix faulty comparison with typed closure by @muglug in https://github.com/vimeo/psalm/pull/7175
    • doesn't infer empty for ReflectionClass::getAttributes without params by @orklah in https://github.com/vimeo/psalm/pull/7180
    • Fixed ignoreTypeStats & useStrictTypes flag value detection for directories in config by @SMAtaurRahman in https://github.com/vimeo/psalm/pull/7182
    • fix #7178 again by @orklah in https://github.com/vimeo/psalm/pull/7189
    • fix other occurences of getAttributes by @orklah in https://github.com/vimeo/psalm/pull/7190
    • MySqli: some parameters are nullable by @igitur in https://github.com/vimeo/psalm/pull/7186
    • allow destructuring on a possible null variable as long as there is an array alongside by @orklah in https://github.com/vimeo/psalm/pull/7193
    • Added pure annotations to enum functions by @ricardoboss in https://github.com/vimeo/psalm/pull/7194
    • fix(stubs): UnitEnum::cases() can return an empty list by @azjezz in https://github.com/vimeo/psalm/pull/7197
    • Add early file filtering to FileProvider::getFilesInDir() by @dvz in https://github.com/vimeo/psalm/pull/7201
    • flag the context as "inside_conditional" when analyzing leftover cases to prevent emitting unused error by @orklah in https://github.com/vimeo/psalm/pull/7203
    • Restore attributes in ClassConstantStorage by @weirdan in https://github.com/vimeo/psalm/pull/7217

    Docs

    • Updated list of current maintainers by @weirdan in https://github.com/vimeo/psalm/pull/7064

    Internal changes

    • Remove useless chunk of code in ScopeAnalyzer by @muglug in https://github.com/vimeo/psalm/pull/7097
    • Use getSingleAtomic() instead of array_values(getAtomicTypes())[0]. by @AndrolGenhald in https://github.com/vimeo/psalm/pull/7134
    • fix some more expressions that can be replaced by getSingleAtomic by @orklah in https://github.com/vimeo/psalm/pull/7137
    • Fix parser cache files maintenance by @dvz in https://github.com/vimeo/psalm/pull/7082
    • Convertion of partials to full imports by @rarila in https://github.com/vimeo/psalm/pull/7155
    • Set allow-plugins for Composer 2.2 by @villfa in https://github.com/vimeo/psalm/pull/7149
    • Codingstyle: declare construct & namespace declaration by @rarila in https://github.com/vimeo/psalm/pull/7165
    • Remove superflous exclude pattern in phpcs.xml by @rarila in https://github.com/vimeo/psalm/pull/7168
    • Removed misleading parentheses after language construct by @kamil-tekiela in https://github.com/vimeo/psalm/pull/7183
    • fix wrong handling of flags in context by @orklah in https://github.com/vimeo/psalm/pull/7195
    • allow phpcodesniffer-composer-installer plugin by @orklah in https://github.com/vimeo/psalm/pull/7205
    • Workaround for PHPUnit process isolation issue with composer 2.2 by @weirdan in https://github.com/vimeo/psalm/pull/7208
    • Remove unused in-array assertions by @muglug in https://github.com/vimeo/psalm/pull/7202

    New Contributors

    • @dvz made their first contribution in https://github.com/vimeo/psalm/pull/7082
    • @yethee made their first contribution in https://github.com/vimeo/psalm/pull/7140
    • @nowaja made their first contribution in https://github.com/vimeo/psalm/pull/7157
    • @igitur made their first contribution in https://github.com/vimeo/psalm/pull/7186

    Full Changelog: https://github.com/vimeo/psalm/compare/v4.15.0...4.16.0

    Source code(tar.gz)
    Source code(zip)
    psalm.phar(11.14 MB)
    psalm.phar.asc(488 bytes)
  • v4.15.0(Dec 7, 2021)

    What's Changed

    Features

    • Improve count_chars stub by @kamil-tekiela in https://github.com/vimeo/psalm/pull/7059
    • Refined *strlen() return type to exclude negative integers by @weirdan in https://github.com/vimeo/psalm/pull/7063
    • Fix #6968: PHP_INT_MAX isn't positive by @ricardoboss in https://github.com/vimeo/psalm/pull/7070
    • Detect yield in array expression by @klimick in https://github.com/vimeo/psalm/pull/7068

    Fixes

    • Refined strlen() return type to not include negative ints by @weirdan in https://github.com/vimeo/psalm/pull/7073
    • Make name property of enum cases return non-empty-strings by @ricardoboss in https://github.com/vimeo/psalm/pull/7077
    • Don't crash when checking purity of __callStatic in a trait by @orklah in https://github.com/vimeo/psalm/pull/7084
    • Fixed generic assertions for list and array by @klimick in https://github.com/vimeo/psalm/pull/7076
    • abs should always return a positive integer by @marcosh in https://github.com/vimeo/psalm/pull/7089

    Internal changes

    • Use import instead of fully qualified namespaces by @rarila in https://github.com/vimeo/psalm/pull/7060
    • Return type hints by @rarila in https://github.com/vimeo/psalm/pull/7065

    Full Changelog: https://github.com/vimeo/psalm/compare/v4.14.0...v4.15.0

    Source code(tar.gz)
    Source code(zip)
    psalm.phar(11.04 MB)
    psalm.phar.asc(488 bytes)
  • v4.14.0(Dec 4, 2021)

    What's Changed

    Features

    • Make UnitEnum name property non-empty by @ricardoboss in https://github.com/vimeo/psalm/pull/6964
    • allow using EnumCase in an Attribute by @orklah in https://github.com/vimeo/psalm/pull/6984
    • Display target PHP version by @weirdan in https://github.com/vimeo/psalm/pull/7006
    • Colorized file name and line in console output by @Rarst in https://github.com/vimeo/psalm/pull/4160
    • Infer ::from() and ::tryFrom() return types on backed enums by @weirdan in https://github.com/vimeo/psalm/pull/7011
    • Added enum-related stubs and callmaps by @weirdan in https://github.com/vimeo/psalm/pull/7012
    • Raise RedundantCast when using array_values on a list (fixes #6988) by @danog in https://github.com/vimeo/psalm/pull/6997
    • refine getdate array structure by @orklah in https://github.com/vimeo/psalm/pull/7032
    • Improved preg_match() output param type inference by @rarila in https://github.com/vimeo/psalm/pull/7027
    • flag usage of get_class outside class without args by @orklah in https://github.com/vimeo/psalm/pull/7043

    Fixes

    • Correct missing key-value for stream_get_meta_data function by @mallardduck in https://github.com/vimeo/psalm/pull/6949
    • fix null propagation in return by @orklah in https://github.com/vimeo/psalm/pull/6952
    • Update $data argument types of file_put_contents by @ciaranmcnulty in https://github.com/vimeo/psalm/pull/6954
    • check __callStatic purity instead of the pseudoMethod purity by @orklah in https://github.com/vimeo/psalm/pull/6953
    • sleep(0) is valid by @BenMorel in https://github.com/vimeo/psalm/pull/6955
    • usleep(0) is valid by @LeSuisse in https://github.com/vimeo/psalm/pull/6961
    • Invalid SoapClient::__doRequest() response type by @veewee in https://github.com/vimeo/psalm/pull/6927
    • prevent Psalm from considering throwing methods as unused just because they're immutable by @orklah in https://github.com/vimeo/psalm/pull/6972
    • Attempt to fix #6937 by @ptomulik in https://github.com/vimeo/psalm/pull/6963
    • fix counting array properties when some are Never by @orklah in https://github.com/vimeo/psalm/pull/6971
    • Attempt fixing issue 6973 by @ptomulik in https://github.com/vimeo/psalm/pull/6974
    • using length instead of count for php 7.1 compatibility by @AlessandroMinoccheri in https://github.com/vimeo/psalm/pull/6981
    • don't accept unresolved literal string as valid callable-strings by @orklah in https://github.com/vimeo/psalm/pull/6979
    • Stub fixes for mysqli extension by @kamil-tekiela in https://github.com/vimeo/psalm/pull/6986
    • Taint can't be transmitted through numerics nor bool by @orklah in https://github.com/vimeo/psalm/pull/6993
    • Disable list flag for TKeyedArray after unset by @orklah in https://github.com/vimeo/psalm/pull/7002
    • Drop special handling of constant references on enums by @weirdan in https://github.com/vimeo/psalm/pull/6995
    • Fix signatures of gmstrftime and strftime by @kamil-tekiela in https://github.com/vimeo/psalm/pull/7008
    • Include enum cases in const wildcards by @weirdan in https://github.com/vimeo/psalm/pull/7010
    • Allow overriding the signature type by a param docblock for promoted properties by @orklah in https://github.com/vimeo/psalm/pull/7013
    • Fix mysqli_fetch_* stubs by @kamil-tekiela in https://github.com/vimeo/psalm/pull/7014
    • Escape GHA output by @weirdan in https://github.com/vimeo/psalm/pull/7016
    • fix signature for openssl_open under PHP >= 8.0 by @pilif in https://github.com/vimeo/psalm/pull/6987
    • refine abs return type by @orklah in https://github.com/vimeo/psalm/pull/7023
    • flag DeprecatedProperty on static fetch by @orklah in https://github.com/vimeo/psalm/pull/7025
    • remove the remaining dynamic property assignment by @orklah in https://github.com/vimeo/psalm/pull/7022
    • ignore irrelevant errors for php-parser 4.13.2 by @orklah in https://github.com/vimeo/psalm/pull/7033
    • Throw exception when baseline file is empty by @kamil-tekiela in https://github.com/vimeo/psalm/pull/7036
    • Fix RedisCluster::getOption() and RedisCluster::setOption() argument types by @ostrolucky in https://github.com/vimeo/psalm/pull/7030
    • get_class does not return false by @kamil-tekiela in https://github.com/vimeo/psalm/pull/7042
    • Consider emptiness for array_count_values() by @weirdan in https://github.com/vimeo/psalm/pull/7045
    • Don't output console links in CI env by @weirdan in https://github.com/vimeo/psalm/pull/7049

    Docs

    • Add --php-version to CLI help by @DaveLiddament in https://github.com/vimeo/psalm/pull/7024
    • document the behavior of methods in IssueBuffer by @orklah in https://github.com/vimeo/psalm/pull/7040

    Internal changes

    • Use return type hints instead of php doc "@return void" by @rarila in https://github.com/vimeo/psalm/pull/7003
    • Make test runnable on plain windows by @rarila in https://github.com/vimeo/psalm/pull/7005
    • Drop unused $fq_classlike_names property by @weirdan in https://github.com/vimeo/psalm/pull/7004
    • Fix failing symlink test on Windows by @rarila in https://github.com/vimeo/psalm/pull/7009
    • Disabled coverage (and xdebug) for CI builds by @weirdan in https://github.com/vimeo/psalm/pull/7017
    • Add tests for UnresolvableInclude by @pawel-slowik in https://github.com/vimeo/psalm/pull/7021
    • Migrate most IssueBuffer::accepts calls to IssueBuffer::maybeAdd by @muglug in https://github.com/vimeo/psalm/pull/7020
    • Prevent VoidProgress from outputting anything by @weirdan in https://github.com/vimeo/psalm/pull/7031
    • Enhancing composer scripts by @rarila in https://github.com/vimeo/psalm/pull/7029
    • Beautified phpcs.xml by @rarila in https://github.com/vimeo/psalm/pull/7041
    • Remove always-false args by @muglug in https://github.com/vimeo/psalm/pull/7056

    New Contributors

    • @mallardduck made their first contribution in https://github.com/vimeo/psalm/pull/6949
    • @ciaranmcnulty made their first contribution in https://github.com/vimeo/psalm/pull/6954
    • @ptomulik made their first contribution in https://github.com/vimeo/psalm/pull/6963
    • @AlessandroMinoccheri made their first contribution in https://github.com/vimeo/psalm/pull/6981

    Full Changelog: https://github.com/vimeo/psalm/compare/4.13.0...v4.14.0

    Source code(tar.gz)
    Source code(zip)
    psalm.phar(11.00 MB)
    psalm.phar.asc(488 bytes)
  • 4.13.1(Nov 23, 2021)

  • 4.13.0(Nov 21, 2021)

    What's Changed

    Features

    • Forbid properties on enums by @weirdan in https://github.com/vimeo/psalm/pull/6836
    • better understands value and name properties for enum by @orklah in https://github.com/vimeo/psalm/pull/6838
    • Added option to forbid eval() in codebase by @thomasbley in https://github.com/vimeo/psalm/pull/6856
    • Use positive integers for various time functions by @danog in https://github.com/vimeo/psalm/pull/6861
    • Flag duplicate constants by @weirdan in https://github.com/vimeo/psalm/pull/6884
    • Add ImagickPixel::getColor return type provider by @danog in https://github.com/vimeo/psalm/pull/6890
    • Fix promoted readonly properties by @trowski in https://github.com/vimeo/psalm/pull/6909
    • ConsoleReport: Add hyperlinks to open file in editor by @gharlan in https://github.com/vimeo/psalm/pull/6850
    • Multiple variables in @psalm-trace by @rarila in https://github.com/vimeo/psalm/pull/6920
    • Reconcile class-constant by @boesing in https://github.com/vimeo/psalm/pull/6529

    Fixes

    • don't consider calls to methods with assertions as Unused by @orklah in https://github.com/vimeo/psalm/pull/6834
    • Forbid enum instantiation by @weirdan in https://github.com/vimeo/psalm/pull/6840
    • Taint comments by @orklah in https://github.com/vimeo/psalm/pull/6848
    • add stub for taint detection on vprintf by @orklah in https://github.com/vimeo/psalm/pull/6847
    • Forbid declaring enums as attributes by @weirdan in https://github.com/vimeo/psalm/pull/6843
    • DOMParentNode and DOMChildNode stubs (php 8) by @jirkace in https://github.com/vimeo/psalm/pull/6851
    • Fixed signature for newInstanceArgs for PHP 8.0 by @jirkace in https://github.com/vimeo/psalm/pull/6852
    • Fixed RedisCluster::setOption() argument types by @jirkace in https://github.com/vimeo/psalm/pull/6853
    • Fixed callmap for function openssl_sign, it changed in PHP 8.0 (modif… by @jirkace in https://github.com/vimeo/psalm/pull/6846
    • allow signature type for promoted property as well as property docblock by @orklah in https://github.com/vimeo/psalm/pull/6872
    • load the ReturnTypeWillChange stubs for all versions to allow using it on every PHP version by @orklah in https://github.com/vimeo/psalm/pull/6873
    • fix never combination by @orklah in https://github.com/vimeo/psalm/pull/6874
    • do not treat __halt_compiler() as an expression being executed by @pilif in https://github.com/vimeo/psalm/pull/6876
    • detect unevaluated inline-html code after an rearly return by @pilif in https://github.com/vimeo/psalm/pull/6878
    • Fix --enable-autocomplete=false by @Nadyita in https://github.com/vimeo/psalm/pull/6880
    • don't stop processing for class usage after raising an issue by @pilif in https://github.com/vimeo/psalm/pull/6899
    • SimpleXMLIterator is not always truthy by @jnvsor in https://github.com/vimeo/psalm/pull/6903
    • make ignore falsable/nullable dependent on the config by @orklah in https://github.com/vimeo/psalm/pull/6895
    • Fix invalid SoapClient::__doRequest() signature by @veewee in https://github.com/vimeo/psalm/pull/6905
    • Fix mb_convert_encoding to accept any array. by @rarila in https://github.com/vimeo/psalm/pull/6910
    • Report deprecated config elements by @weirdan in https://github.com/vimeo/psalm/pull/6913
    • Infer mb_strtolower() result as string when encoding is specified by @weirdan in https://github.com/vimeo/psalm/pull/6912
    • Allow references to enum cases in class constants by @weirdan in https://github.com/vimeo/psalm/pull/6922
    • session_set_cookie_params signature changed in 8.0 by @kamil-tekiela in https://github.com/vimeo/psalm/pull/6932
    • expand type aliases when comparing unions by @sebkehr in https://github.com/vimeo/psalm/pull/6946

    Docs

    • Added ext-curl to composer.json suggest property by @sasezaki in https://github.com/vimeo/psalm/pull/6844

    Internal changes

    • Added test for NoEnumProperties by @weirdan in https://github.com/vimeo/psalm/pull/6839
    • Added phpcs SelfMemberReference rule, and applied by @sasezaki in https://github.com/vimeo/psalm/pull/6845

    Typos

    • Fix typos in message about Attribute usage by @ricardoboss in https://github.com/vimeo/psalm/pull/6904

    New Contributors

    • @jirkace made their first contribution in https://github.com/vimeo/psalm/pull/6851
    • @Nadyita made their first contribution in https://github.com/vimeo/psalm/pull/6880
    • @jnvsor made their first contribution in https://github.com/vimeo/psalm/pull/6903
    • @ricardoboss made their first contribution in https://github.com/vimeo/psalm/pull/6904
    • @veewee made their first contribution in https://github.com/vimeo/psalm/pull/6905
    • @rarila made their first contribution in https://github.com/vimeo/psalm/pull/6910
    • @kamil-tekiela made their first contribution in https://github.com/vimeo/psalm/pull/6932
    • @sebkehr made their first contribution in https://github.com/vimeo/psalm/pull/6946

    Full Changelog: https://github.com/vimeo/psalm/compare/4.12.0...4.13.0

    Source code(tar.gz)
    Source code(zip)
    psalm.phar(10.94 MB)
    psalm.phar.asc(488 bytes)
  • 4.12.0(Nov 6, 2021)

    What's Changed

    Deprecations

    • deprecate TEmpty by @orklah in https://github.com/vimeo/psalm/pull/6763
    • deprecate exitFunctions in XML by @orklah in https://github.com/vimeo/psalm/pull/6807

    Features

    • allow documenting promoted properties with @var by @orklah in https://github.com/vimeo/psalm/pull/6764
    • Support PHP_VERSION_ID in conditional types by @sad-spirit in https://github.com/vimeo/psalm/pull/6783
    • Ability to forbid exit() and die() by @weirdan in https://github.com/vimeo/psalm/pull/6784
    • emit UnevaluatedCode after exit or never returning functionlike by @orklah in https://github.com/vimeo/psalm/pull/6793
    • Template support for @psalm-self-out by @danog in https://github.com/vimeo/psalm/pull/6768

    Fixes

    • throwable Instanceof throwable negated by @orklah in https://github.com/vimeo/psalm/pull/6746
    • Updated openssl_pkey_get_private function signature by @pls78 in https://github.com/vimeo/psalm/pull/6758
    • Fix template parameter collection for child classes with fewer parameters (fixes #6734) by @danog in https://github.com/vimeo/psalm/pull/6742
    • fix local variable defined too early by @orklah in https://github.com/vimeo/psalm/pull/6774
    • fix is_a when used with Stringable classes by @orklah in https://github.com/vimeo/psalm/pull/6775
    • remove second autoloader call by @orklah in https://github.com/vimeo/psalm/pull/6776
    • Correct pgsql stubs by @sad-spirit in https://github.com/vimeo/psalm/pull/6777
    • detect Yield in new by @orklah in https://github.com/vimeo/psalm/pull/6790
    • accept ::class constant strings for literal argument by @sasezaki in https://github.com/vimeo/psalm/pull/6801
    • Add pcntl_alarm to the list of impure functions by @l-x in https://github.com/vimeo/psalm/pull/6802
    • added mysqli::connect() to callmap by @SMAtaurRahman in https://github.com/vimeo/psalm/pull/6805
    • add "error" from php-parser to baseline by @orklah in https://github.com/vimeo/psalm/pull/6815
    • Improved Github Actions output by @weirdan in https://github.com/vimeo/psalm/pull/6818
    • backticks shell_exec taint by @orklah in https://github.com/vimeo/psalm/pull/6812
    • Array cast pass taints by @orklah in https://github.com/vimeo/psalm/pull/6810
    • don't taint the result of most binary operations by @orklah in https://github.com/vimeo/psalm/pull/6809
    • don't register taints for numeric variables by @orklah in https://github.com/vimeo/psalm/pull/6813
    • allow assertion to work on $var::class by @orklah in https://github.com/vimeo/psalm/pull/6823
    • Fix parameter names in CoreGenericFunctions.phpstub for PHP 8 named p… by @tminich in https://github.com/vimeo/psalm/pull/6820
    • Allow Symfony 6 by @loic425 in https://github.com/vimeo/psalm/pull/6663
    • allow declaring functions and classLikes after a never-returning call by @orklah in https://github.com/vimeo/psalm/pull/6828
    • Makes $_SESSION possibly undefined at the source by @orklah in https://github.com/vimeo/psalm/pull/6824
    • create a tmp fake var for ternaries inside coalesce by @orklah in https://github.com/vimeo/psalm/pull/6825
    • only return true in Union::isType if there is a single type by @orklah in https://github.com/vimeo/psalm/pull/6829
    • Mixed contain every types and Never is contained in every type by @orklah in https://github.com/vimeo/psalm/pull/6830

    Docs

    • Removed PHPUnit coverage badge by @sasezaki in https://github.com/vimeo/psalm/pull/6816

    Internal changes

    • Require one of release:* labels on PRs by @weirdan in https://github.com/vimeo/psalm/pull/6785
    • Added 'Removed' section to release notes by @weirdan in https://github.com/vimeo/psalm/pull/6811
    • chore(ci): update psl version used in e2e tests by @azjezz in https://github.com/vimeo/psalm/pull/6766
    • add PSL back to CI by @orklah in https://github.com/vimeo/psalm/pull/6833

    New Contributors

    • @pls78 made their first contribution in https://github.com/vimeo/psalm/pull/6758
    • @sad-spirit made their first contribution in https://github.com/vimeo/psalm/pull/6777
    • @tminich made their first contribution in https://github.com/vimeo/psalm/pull/6820
    • @loic425 made their first contribution in https://github.com/vimeo/psalm/pull/6663

    Full Changelog: https://github.com/vimeo/psalm/compare/4.11.2...4.12.0

    Source code(tar.gz)
    Source code(zip)
    psalm.phar(10.92 MB)
    psalm.phar.asc(488 bytes)
Owner
Vimeo
You know, for videos.
Vimeo
Beautiful and understandable static analysis tool for PHP

PhpMetrics PhpMetrics provides metrics about PHP project and classes, with beautiful and readable HTML report. Documentation | Twitter | Contributing

PhpMetrics 2.3k Dec 22, 2022
A static php code analysis tool using the Graph Theory

Mondrian Ok guyz, you have a master degree in Graph Theory, you follow Law of Demeter and you live on S.O.L.I.D principles ? Let's have some Fun ! (^ω

Florent Genette 391 Nov 30, 2022
Deptrac is a static code analysis tool for PHP that helps you communicate, visualize and enforce architectural decisions in your projects

Deptrac is a static code analysis tool for PHP that helps you communicate, visualize and enforce architectural decisions in your projects. You can freely define your architectural layers over classes and which rules should apply to them.

QOSSMIC GmbH 2.2k Dec 30, 2022
A static analysis tool for security

progpilot A static analyzer for security purposes Only PHP language is currently supported Installation Option 1: use standalone phar Download the lat

null 271 Dec 27, 2022
Performs advanced static analysis on PHP code

PHP Analyzer Please report bugs or feature requests via our website support system ? in bottom right or by emailing [email protected]. Contri

Continuous Inspection 443 Sep 23, 2022
The Exakat Engine : smart static analysis for PHP

Exakat The Exakat Engine is an automated code reviewing engine for PHP. Installation Installation with the phar Phar is the recommended installation p

Exakat 370 Dec 28, 2022
Static code analysis to find violations in a dependency graph

PhpDependencyAnalysis PhpDependencyAnalysis is an extendable static code analysis for object-oriented PHP-Projects to generate dependency graphs from

Marco Muths 546 Dec 7, 2022
Static Analysis Results Baseliner

Static Analysis Results Baseliner (SARB) Why SARB Requirements Installing Using SARB Examples Further reading Why SARB? If you've tried to introduce a

Dave Liddament 151 Jan 3, 2023
Infection Static Analysis Plugin

Static analysis on top of mutation testing - prevents escaped mutants from being invalid according to static analysis

Roave, LLC 108 Jan 2, 2023
A set of tools for lexical and syntactical analysis written in pure PHP.

Welcome to Dissect! master - this branch always contains the last stable version. develop - the unstable development branch. Dissect is a set of tools

Jakub Lédl 221 Nov 29, 2022
A project to add Psalm support for Drupal for security testing, focused only on taint analysis.

psalm-plugin-drupal A Drupal integration for Psalm focused on security scanning (SAST) taint analysis. Features Stubs for sinks, sources, and sanitize

Samuel Mortenson 38 Aug 29, 2022
Phan is a static analyzer for PHP. Phan prefers to avoid false-positives and attempts to prove incorrectness rather than correctness.

Phan is a static analyzer for PHP that prefers to minimize false-positives. Phan attempts to prove incorrectness rather than correctness. Phan looks f

null 5.4k Jan 7, 2023
A static analyzer for PHP version migration

PHP Migration Readme in Chinese 中文 This is a static analyzer for PHP version migration and compatibility checking. It can suppose your current code ru

Yuchen Wang 194 Sep 27, 2022
SonarPHP: PHP static analyzer for SonarQube & SonarLint

Code Quality and Security for PHP This SonarSource project is a static code analyser for PHP language used as an extension for the SonarQube platform.

SonarSource 343 Dec 25, 2022
Parse: A Static Security Scanner

Parse: A PHP Security Scanner PLEASE NOTE: This tool is still in a very early stage. The work continues... The Parse scanner is a static scanning tool

psec.io 342 Jan 2, 2023
PHPMD is a spin-off project of PHP Depend and aims to be a PHP equivalent of the well known Java tool PMD. PHPMD can be seen as an user friendly frontend application for the raw metrics stream measured by PHP Depend.

PHPMD PHPMD is a spin-off project of PHP Depend and aims to be a PHP equivalent of the well known Java tool PMD. PHPMD can be seen as an user friendly

PHP Mess Detector 2.1k Jan 8, 2023
A fake mailer for Laravel Applications for testing mail.

MailThief MailThief is a fake mailer for Laravel applications (5.0+) that makes it easy to test mail without actually sending any emails. Note: Due to

Tighten 688 Nov 29, 2022
PHP Architecture Tester - Easy to use architectural testing tool for PHP :heavy_check_mark:

Easy to use architecture testing tool for PHP Introduction ?? PHP Architecture Tester is a static analysis tool to verify architectural requirements.

Carlos A Sastre 765 Dec 30, 2022
A tool to automatically fix PHP Coding Standards issues

PHP Coding Standards Fixer The PHP Coding Standards Fixer (PHP CS Fixer) tool fixes your code to follow standards; whether you want to follow PHP codi

null 11.6k Jan 3, 2023