Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False-positive: Call to private method find* #333

Closed
sylfabre opened this issue May 24, 2022 · 7 comments
Closed

False-positive: Call to private method find* #333

sylfabre opened this issue May 24, 2022 · 7 comments

Comments

@sylfabre
Copy link

sylfabre commented May 24, 2022

Hello

I have 3 entities and related repositories to handle bank accounts in my code:

  • abstract class AbstractBankAccount with properties like $name
  • class EuropeanBankAccount extends AbstractBankAccount with properties like $iban
  • class UsBankAccount extends AbstractBankAccount with properties like $accountNumber or $branchCode as there is no IBAN in the US

I also have repositories for each entity. Our repositories extend from a custom based repository providing custom generic methods

/**
 * @template T of object
 * @extends ServiceEntityRepository<T>
 */
abstract class AbstractRepository extends ServiceEntityRepository

AbstractBankAccountRepository returns any implementation of AbstractBankAccount

/**
 * @template T of AbstractBankAccount
 * @extends AbstractRepository<T>
 */
class AbstractBankAccountRepository extends AbstractRepository
{
    public function __construct(ManagerRegistry $registry, string $entityClass = AbstractBankAccount::class)
    {
        parent::__construct($registry, $entityClass);
    }
}

EuropeanBankAccountRepository only returns EuropeanBankAccount entities

/**
 * @extends AbstractBankAccountRepository<EuropeanBankAccount>
 */
class EuropeanBankAccountRepository extends AbstractBankAccountRepository
{
    public function __construct(ManagerRegistry $registry)
    {
        parent::__construct($registry, EuropeanBankAccount::class);
    }
}

UsBankAccountRepository only returns UsBankAccount entities

/**
 * @extends AbstractBankAccountRepository<UsBankAccount>
 */
class UsBankAccountRepository extends AbstractBankAccountRepository
{
    public function __construct(ManagerRegistry $registry)
    {
        parent::__construct($registry, UsBankAccount::class);
    }
}

phpstan reports this error

 ------ ------------------------------------------------------------------------------------------------------------------------------------------------
  Line   OperationApiDtoVoterTest.php
 ------ ------------------------------------------------------------------------------------------------------------------------------------------------
  85     Call to private method findOneByName() of parent class App\Repository\AbstractRepository<T of App\Utility\Banking\Entity\AbstractBankAccount>.
 ------ ------------------------------------------------------------------------------------------------------------------------------------------------

for this call

static::getContainer()->get(AbstractBankAccountRepository::class)->findOneByName(FixturesReference::BANK_ACCOUNT_ADYEN_FR_NAME)
  • This code is part of a PHPUnit test which works without issue.
  • The findOneByName() method is one of the Doctrine magic ones and is not overridden in our codebase.
  • I tried to find out why phpstan is reporting this but had no luck
@sylfabre
Copy link
Author

@ondrejmirtes I'd gladly submit a PR for this because I think it's an easy fix but I can't find in this extension codebase where the visibility of these magic methods is defined.
Can you please point me in the right direction?

@ondrejmirtes
Copy link
Member

Please reproduce this issue in a small repository. Then we're gonna be wiser about why it's happening.

@MPur
Copy link

MPur commented Feb 13, 2023

Hello @ondrejmirtes,
To reproduce this issue, I made a small repository here. In CI job, you can see a phpstan report with the error that @sylfabre talked about earlier.

I hope this can help you.

@sylfabre
Copy link
Author

sylfabre commented Apr 4, 2023

Hello @ondrejmirtes

How can we help you to fix this issue?
Is the reproducer from @MPur ok for you?

@ondrejmirtes
Copy link
Member

Fixed in PHPStan: phpstan/phpstan-src@1017dc7

Regression test here: c1c32c9

@sylfabre
Copy link
Author

Thank you @ondrejmirtes 👍

renovate bot added a commit to Lendable/composer-license-checker that referenced this issue Apr 20, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [phpstan/phpstan](https://togithub.com/phpstan/phpstan) | require-dev
| patch | `^1.10.10` -> `^1.10.14` |
| [phpunit/phpunit](https://phpunit.de/)
([source](https://togithub.com/sebastianbergmann/phpunit)) | require-dev
| minor | `^10.0.19` -> `^10.1.1` |
| [rector/rector](https://getrector.org)
([source](https://togithub.com/rectorphp/rector)) | require-dev | patch
| `^0.15.23` -> `^0.15.24` |

---

### Release Notes

<details>
<summary>phpstan/phpstan</summary>

###
[`v1.10.14`](https://togithub.com/phpstan/phpstan/releases/tag/1.10.14)

[Compare
Source](https://togithub.com/phpstan/phpstan/compare/1.10.13...1.10.14)

# Bleeding edge 🔪

- Check `filter_input*` type param type
([#&#8203;2271](https://togithub.com/phpstan/phpstan-src/pull/2271)),
thanks [@&#8203;herndlm](https://togithub.com/herndlm)!

*If you want to see the shape of things to come and adopt bleeding edge
features early, you can include this config file in your project's
`phpstan.neon`:*

    includes:
    	- vendor/phpstan/phpstan/conf/bleedingEdge.neon

*Of course, there are no backwards compatibility guarantees when you
include this file. The behaviour and reported errors can change in minor
versions with this file included. [Learn
more](https://phpstan.org/blog/what-is-bleeding-edge)*

# Improvements 🔧

-   Update phpdoc-parser
-
[Changelog](https://togithub.com/phpstan/phpdoc-parser/compare/22dcdfd725ddf99583bfe398fc624ad6c5004a0f...f545fc30978190a056832aa7ed995e36a66267f3)
- Add extension to add additional constructors through code
([#&#8203;2348](https://togithub.com/phpstan/phpstan-src/pull/2348)),
thanks [@&#8203;raalderink](https://togithub.com/raalderink)!
-
[phpstan/phpstan-symfony#346

# Bugfixes 🐛

- Fix `BackedEnum::tryFrom` not being nullable
([#&#8203;2302](https://togithub.com/phpstan/phpstan-src/pull/2302)),
thanks [@&#8203;schlndh](https://togithub.com/schlndh)!
- Specify `never` for `array_combine` with different number of elements
([#&#8203;2303](https://togithub.com/phpstan/phpstan-src/pull/2303)),
thanks [@&#8203;herndlm](https://togithub.com/herndlm)!
- ConstantFloatType - fix `equals()`
(phpstan/phpstan-src@e01ce68)
- Fix INF logic
(phpstan/phpstan-src@fc673ee)
- Prevent false-positive in `get_parent_class()` on interfaces
([#&#8203;2336](https://togithub.com/phpstan/phpstan-src/pull/2336)),
[#&#8203;4302](https://togithub.com/phpstan/phpstan/issues/4302), thanks
[@&#8203;staabm](https://togithub.com/staabm)!

# Function signature fixes 🤖

- Fix `Memcache/MemcachePool::get` method signature
([#&#8203;2344](https://togithub.com/phpstan/phpstan-src/pull/2344)),
thanks [@&#8203;dravnic](https://togithub.com/dravnic)!

# Internals 🔍

- `Type::toPhpDocNode()`
(phpstan/phpstan-src@8633125)
- Remove `symfony/polyfill-php72`
(phpstan/phpstan-src@8ff8fb0)

###
[`v1.10.13`](https://togithub.com/phpstan/phpstan/releases/tag/1.10.13)

[Compare
Source](https://togithub.com/phpstan/phpstan/compare/1.10.12...1.10.13)

- Fix internal error: FilterVarArrayDynamicReturnTypeExtension for
`mixed` input
([#&#8203;2338](https://togithub.com/phpstan/phpstan-src/pull/2338)),
[#&#8203;9178](https://togithub.com/phpstan/phpstan/issues/9178), thanks
[@&#8203;zonuexe](https://togithub.com/zonuexe)!

###
[`v1.10.12`](https://togithub.com/phpstan/phpstan/releases/tag/1.10.12)

[Compare
Source](https://togithub.com/phpstan/phpstan/compare/1.10.11...1.10.12)

# Major new features 🚀

- Object shapes,
[#&#8203;2923](https://togithub.com/phpstan/phpstan/issues/2923)
-
[Documentation](https://phpstan.org/writing-php-code/phpdoc-types#object-shapes)
- [Twitter
thread](https://twitter.com/OndrejMirtes/status/1643873013731844096)
about implementing it
- [phpdoc-parser
implementation](https://togithub.com/phpstan/phpdoc-parser/commit/882eabc9b6a12e25c27091a261397f9c8792e722)

# Bleeding edge 🔪

- Stricter function signature map
(phpstan/phpstan-src@06b746d,
[#&#8203;2163](https://togithub.com/phpstan/phpstan-src/pull/2163)),
[#&#8203;7239](https://togithub.com/phpstan/phpstan/issues/7239), thanks
[@&#8203;staabm](https://togithub.com/staabm)!
- Specify `Imagick` parameter types
([#&#8203;2334](https://togithub.com/phpstan/phpstan-src/pull/2334)),
thanks [@&#8203;zonuexe](https://togithub.com/zonuexe)!

*If you want to see the shape of things to come and adopt bleeding edge
features early, you can include this config file in your project's
`phpstan.neon`:*

    includes:
    	- vendor/phpstan/phpstan/conf/bleedingEdge.neon

*Of course, there are no backwards compatibility guarantees when you
include this file. The behaviour and reported errors can change in minor
versions with this file included. [Learn
more](https://phpstan.org/blog/what-is-bleeding-edge)*

# Improvements 🔧

- Improve `filter_*` array handling, support `FILTER_REQUIRE_ARRAY`
([#&#8203;2318](https://togithub.com/phpstan/phpstan-src/pull/2318)),
thanks [@&#8203;herndlm](https://togithub.com/herndlm)!
- Asymmetric `@property` types
([#&#8203;2327](https://togithub.com/phpstan/phpstan-src/pull/2327),
[#&#8203;2328](https://togithub.com/phpstan/phpstan-src/pull/2328),
[#&#8203;2329](https://togithub.com/phpstan/phpstan-src/pull/2329)),
[#&#8203;9062](https://togithub.com/phpstan/phpstan/issues/9062), thanks
[@&#8203;jtojnar](https://togithub.com/jtojnar)!
- Specify return type for `filter_input()`
([#&#8203;2010](https://togithub.com/phpstan/phpstan-src/pull/2010)),
[#&#8203;6261](https://togithub.com/phpstan/phpstan/issues/6261), thanks
[@&#8203;herndlm](https://togithub.com/herndlm)!
- Improve return type precision of `filter_input` with invalid first
args
([#&#8203;2333](https://togithub.com/phpstan/phpstan-src/pull/2333)),
thanks [@&#8203;herndlm](https://togithub.com/herndlm)!
- Allow `@property` and `@method` to override above the same class
(phpstan/phpstan-src@3467a21)
- Add `FilterVarArrayDynamicReturnTypeExtension`
([#&#8203;2257](https://togithub.com/phpstan/phpstan-src/pull/2257)),
thanks [@&#8203;zonuexe](https://togithub.com/zonuexe)!

# Bugfixes 🐛

- Fix usage of `TypeSpecifierContext::truthy()`
([#&#8203;2230](https://togithub.com/phpstan/phpstan-src/pull/2230)),
[#&#8203;3013](https://togithub.com/phpstan/phpstan/issues/3013),
[#&#8203;7686](https://togithub.com/phpstan/phpstan/issues/7686), thanks
[@&#8203;VincentLanglet](https://togithub.com/VincentLanglet)!
- Parent template type should respect child class bound when unspecified
(phpstan/phpstan-src@1017dc7),
[phpstan/phpstan-doctrine#333
- Fix bug with match expression and `treatPhpDocTypesAsCertain`
([#&#8203;2250](https://togithub.com/phpstan/phpstan-src/pull/2250)),
[#&#8203;8937](https://togithub.com/phpstan/phpstan/issues/8937), thanks
[@&#8203;VincentLanglet](https://togithub.com/VincentLanglet)!
- Generics: fix position variance of readonly-by-phpdoc properties
([#&#8203;2337](https://togithub.com/phpstan/phpstan-src/pull/2337)),
[#&#8203;9153](https://togithub.com/phpstan/phpstan/issues/9153), thanks
[@&#8203;jiripudil](https://togithub.com/jiripudil)!
- PHPStan Pro - show errors from CollectedData
(phpstan/phpstan-src@b85a961)
- Fix methods in IntersectionTypePropertyReflection
(phpstan/phpstan-src@d1c4c6d)

# Function signature fixes 🤖

- Improve Imagick method types
([#&#8203;2325](https://togithub.com/phpstan/phpstan-src/pull/2325)),
thanks [@&#8203;zonuexe](https://togithub.com/zonuexe)!

# Internals 🔍

- Switch to `cweagans/composer-patches`
([#&#8203;2307](https://togithub.com/phpstan/phpstan-src/pull/2307)),
thanks [@&#8203;herndlm](https://togithub.com/herndlm)!
- WritingToReadOnlyPropertiesRule - hook on better node
(phpstan/phpstan-src@bddf573)
- Validate usages of `assert*` functions in TypeInferenceTestCase
([#&#8203;2326](https://togithub.com/phpstan/phpstan-src/pull/2326)),
thanks [@&#8203;staabm](https://togithub.com/staabm)!

###
[`v1.10.11`](https://togithub.com/phpstan/phpstan/releases/tag/1.10.11)

[Compare
Source](https://togithub.com/phpstan/phpstan/compare/1.10.10...1.10.11)

# Bleeding edge 🔪

- Fix position variance of static method parameters
([#&#8203;2313](https://togithub.com/phpstan/phpstan-src/pull/2313)),
thanks [@&#8203;jiripudil](https://togithub.com/jiripudil)!
- Check variance of template types in properties
([#&#8203;2314](https://togithub.com/phpstan/phpstan-src/pull/2314)),
thanks [@&#8203;jiripudil](https://togithub.com/jiripudil)!
- OverridingMethodRule - include template types in prototype declaring
class description
(phpstan/phpstan-src@ca2c66c)

*If you want to see the shape of things to come and adopt bleeding edge
features early, you can include this config file in your project's
`phpstan.neon`:*

    includes:
    	- vendor/phpstan/phpstan/conf/bleedingEdge.neon

*Of course, there are no backwards compatibility guarantees when you
include this file. The behaviour and reported errors can change in minor
versions with this file included. [Learn
more](https://phpstan.org/blog/what-is-bleeding-edge)*

# Improvements 🔧

- Helper PHPDoc type: `template-type` (calling `Type::getTemplateType()`
method)
(phpstan/phpstan-src@b6d0c87),
[https://github.com/phpstan/phpstan/discussions/9053](https://togithub.com/phpstan/phpstan/discussions/9053)
- Some useful advanced PHPDoc types
(phpstan/phpstan-src@387ebd5)
    -   `enum-string`
    -   `empty-scalar`
    -   `non-empty-scalar`
    -   `non-empty-literal-string`
    -   `pure-callable`
    -   `closed-resource`
    -   `non-empty-mixed`
    -   `callable-array`
- RuleErrorBuilder - support multiple tips nicely
(phpstan/phpstan-src@e06c529)
- StrictComparisonOfDifferentTypesRule - tip for always true comparison
between enums
(phpstan/phpstan-src@a327965,
phpstan/phpstan-src@9850ea7)
- Handle invalid type aliases better
(phpstan/phpstan-src@fc5515a),
[#&#8203;9077](https://togithub.com/phpstan/phpstan/issues/9077),
[#&#8203;8473](https://togithub.com/phpstan/phpstan/issues/8473)
    -   Uses phpstan/phpdoc-parser 1.17
-
phpstan/phpdoc-parser@bfec872
-
phpstan/phpdoc-parser@d3753fc

# Bugfixes 🐛

- Be smarter about new array keys after assignment
(phpstan/phpstan-src@6c32371),
[#&#8203;9131](https://togithub.com/phpstan/phpstan/issues/9131),
[#&#8203;8900](https://togithub.com/phpstan/phpstan/issues/8900),
[#&#8203;8222](https://togithub.com/phpstan/phpstan/issues/8222)
- Fix `StaticType::isSuperTypeOf()` for subtypes of `ObjectType`
(phpstan/phpstan-src@b439fed),
[#&#8203;9142](https://togithub.com/phpstan/phpstan/issues/9142)
- `TypehintHelper::decideTypeFromReflection()` should accept correct
ancestor's ClassReflection, not just class name
(phpstan/phpstan-src@297a9fe)

# Function signature fixes 🤖

- Add types for `IntlPartsIterator`
([#&#8203;2324](https://togithub.com/phpstan/phpstan-src/pull/2324)),
thanks [@&#8203;zonuexe](https://togithub.com/zonuexe)!

</details>

<details>
<summary>sebastianbergmann/phpunit</summary>

###
[`v10.1.1`](https://togithub.com/sebastianbergmann/phpunit/compare/10.1.0...10.1.1)

[Compare
Source](https://togithub.com/sebastianbergmann/phpunit/compare/10.1.0...10.1.1)

###
[`v10.1.0`](https://togithub.com/sebastianbergmann/phpunit/compare/10.0.19...10.1.0)

[Compare
Source](https://togithub.com/sebastianbergmann/phpunit/compare/10.0.19...10.1.0)

</details>

<details>
<summary>rectorphp/rector</summary>

###
[`v0.15.24`](https://togithub.com/rectorphp/rector/releases/tag/0.15.24):
Released Rector 0.15.24

[Compare
Source](https://togithub.com/rectorphp/rector/compare/0.15.23...0.15.24)

#### New Features 🥳

- Performance: Improve node name resolver performance
([#&#8203;3506](https://togithub.com/rectorphp/rector-src/pull/3506)),
Thanks [@&#8203;keulinho](https://togithub.com/keulinho)!
- \[CodeQuality] Add SwitchTrueToIfRector
([#&#8203;3535](https://togithub.com/rectorphp/rector-src/pull/3535))
- \[CodeQuality] Add cast scalar support on
ReturnTypeFromStrictScalarRector
([#&#8203;3544](https://togithub.com/rectorphp/rector-src/pull/3544))
- Improve ArraySpreadInsteadOfArrayMergeRector
([#&#8203;3551](https://togithub.com/rectorphp/rector-src/pull/3551)),
Thanks [@&#8203;yguedidi](https://togithub.com/yguedidi)!
- Performance: reduce parent attribute usage on BetterNodeFinder
([#&#8203;3504](https://togithub.com/rectorphp/rector-src/pull/3504))
- Performance: using findFirst() when possible at BetterNodeFinder
([#&#8203;3505](https://togithub.com/rectorphp/rector-src/pull/3505))
- Performance: use direct find() instead of lookup all nodes then filter
on BetterNodeFinder
([#&#8203;3507](https://togithub.com/rectorphp/rector-src/pull/3507))
- Performance: Use faster hashing algo for cache key generation
([#&#8203;3508](https://togithub.com/rectorphp/rector-src/pull/3508)),
Thanks [@&#8203;keulinho](https://togithub.com/keulinho)!

<br>

#### Bugfixes 🐛

- Add not null compare to FlipTypeControlToUseExclusiveTypeRector
([#&#8203;3513](https://togithub.com/rectorphp/rector-src/pull/3513))
- \[CodeQuality] Skip static class const fetch on
InlineConstructorDefaultToPropertyRector
([#&#8203;3510](https://togithub.com/rectorphp/rector-src/pull/3510))
- \[CodingStyle] Make EncapsedStringsToSprintfRector work with two
string concat
([#&#8203;3515](https://togithub.com/rectorphp/rector-src/pull/3515))
- \[CodeQuality] Handle multiple ifs on
SimplifyIfExactValueReturnValueRector
([#&#8203;3527](https://togithub.com/rectorphp/rector-src/pull/3527))
- \[NodeManipulator] Reduce parent attribute usage on
VariableManipulator
([#&#8203;3528](https://togithub.com/rectorphp/rector-src/pull/3528))
- \[NodeTypeResolver] Make NodeTraverser as property on
PHPStanNodeScopeResolver
([#&#8203;3533](https://togithub.com/rectorphp/rector-src/pull/3533))
- \[NodeTypeResolver] Make NodeTraverser as property on
NodeScopeAndMetadataDecorator
([#&#8203;3532](https://togithub.com/rectorphp/rector-src/pull/3532))
- \[NodeAnalyzer] Use PHPStan ClassReflection to detect anonymous class
on ClassAnalyzer
([#&#8203;3543](https://togithub.com/rectorphp/rector-src/pull/3543))
- \[Php81] Merge attributes on NewInInitializerRector
([#&#8203;3546](https://togithub.com/rectorphp/rector-src/pull/3546))
- \[Php81] Handle assign op append on ReadOnlyPropertyRector
([#&#8203;3552](https://togithub.com/rectorphp/rector-src/pull/3552))
- \[CodeQuality] Skip empty cases on SwitchTrueToIfRector
([#&#8203;3556](https://togithub.com/rectorphp/rector-src/pull/3556))
- RemoveNonExistingVarAnnotationRector: Allow return annotations
([#&#8203;3534](https://togithub.com/rectorphp/rector-src/pull/3534)),
Thanks [@&#8203;jlherren](https://togithub.com/jlherren)!
- \[PostRector] Skip remove unused used at
[@&#8203;see](https://togithub.com/see) for Generic tag
([#&#8203;3562](https://togithub.com/rectorphp/rector-src/pull/3562))
- \[PostRector] Skip remove unused use on used as ConstFetchNode, eg:
TypeKind::\*
([#&#8203;3560](https://togithub.com/rectorphp/rector-src/pull/3560))

<br>

#### Removed 💀

- \[CodeQuality] Remove next node attribute usage on
SimplifyIfExactValueReturnValueRector
([#&#8203;3511](https://togithub.com/rectorphp/rector-src/pull/3511))
- \[CodingStyle] Remove previous node attribute on
WrapEncapsedVariableInCurlyBracesRector
([#&#8203;3512](https://togithub.com/rectorphp/rector-src/pull/3512))
- \[CodeQuality] Remove next node attribute usage on
SimplifyIfNotNullReturnRector
([#&#8203;3517](https://togithub.com/rectorphp/rector-src/pull/3517))
- Remove deprecated [@&#8203;noRector](https://togithub.com/noRector)
warning
([#&#8203;3518](https://togithub.com/rectorphp/rector-src/pull/3518))
- \[CodingStyle] Remove next node attribute on
NewlineAfterStatementRector
([#&#8203;3525](https://togithub.com/rectorphp/rector-src/pull/3525))
- \[Privatization] Remove parent attribute usage on
PrivatizeFinalClassMethodRector
([#&#8203;3526](https://togithub.com/rectorphp/rector-src/pull/3526))
- \[NodeTypeResolver] Remove
NodeScopeAndMetadataDecorator::decorateStmtsFromString() method
([#&#8203;3530](https://togithub.com/rectorphp/rector-src/pull/3530))
- \[DeadCode] Remove previous attribute usage on
RemoveDeadConditionAboveReturnRector
([#&#8203;3538](https://togithub.com/rectorphp/rector-src/pull/3538))
- \[Php70] Remove previous attribute usage on
ReduceMultipleDefaultSwitchRector
([#&#8203;3537](https://togithub.com/rectorphp/rector-src/pull/3537))
- \[CodingStyle] Remove parent attribute usage on
RemoveFinalFromConstRector
([#&#8203;3536](https://togithub.com/rectorphp/rector-src/pull/3536))
- \[CodingStyle] Remove previous node attribute on
TernaryConditionVariableAssignmentRector
([#&#8203;3540](https://togithub.com/rectorphp/rector-src/pull/3540))
- \[DeadCode] Remove previous and parent attribute usage on
RemoveNullPropertyInitializationRector
([#&#8203;3541](https://togithub.com/rectorphp/rector-src/pull/3541))
- \[DeadCode] Remove property comment same line on
RemoveUnusedPrivatePropertyRector
([#&#8203;3547](https://togithub.com/rectorphp/rector-src/pull/3547))
- \[PSR4] Remove clone $node on
NormalizeNamespaceByPSR4ComposerAutoloadRector
([#&#8203;3553](https://togithub.com/rectorphp/rector-src/pull/3553))
- \[PSR4] Remove clone $node on PseudoNamespaceToNamespaceRector
([#&#8203;3554](https://togithub.com/rectorphp/rector-src/pull/3554))
- \[Tests] Remove RunTestsInSeparateProcesses in rules-tests
([#&#8203;3555](https://togithub.com/rectorphp/rector-src/pull/3555))
- \[NodeRemover] Use return null after $this->removeNode()
([#&#8203;3558](https://togithub.com/rectorphp/rector-src/pull/3558))
- \[Php73] Remove next node attribute usage on ArrayKeyFirstLastRector
([#&#8203;3559](https://togithub.com/rectorphp/rector-src/pull/3559))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config help](https://togithub.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://app.renovatebot.com/dashboard#github/Lendable/composer-license-checker).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4zMi4yIiwidXBkYXRlZEluVmVyIjoiMzUuNTQuMCJ9-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Ben Challis <ben@lendable.co.uk>
renovate bot added a commit to ben-challis/sql-migrations that referenced this issue May 1, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [phpstan/phpstan](https://togithub.com/phpstan/phpstan) | require-dev
| patch | `^1.10.11` -> `^1.10.13` |
| [phpunit/phpunit](https://phpunit.de/)
([source](https://togithub.com/sebastianbergmann/phpunit)) | require-dev
| patch | `^9.6.6` -> `^9.6.7` |
| [rector/rector](https://getrector.org)
([source](https://togithub.com/rectorphp/rector)) | require-dev | patch
| `^0.15.23` -> `^0.15.24` |

---

### ⚠ Dependency Lookup Warnings ⚠

Warnings were logged while processing this repo. Please check the
Dependency Dashboard for more information.

---

### Release Notes

<details>
<summary>phpstan/phpstan</summary>

###
[`v1.10.13`](https://togithub.com/phpstan/phpstan/releases/tag/1.10.13)

[Compare
Source](https://togithub.com/phpstan/phpstan/compare/1.10.12...1.10.13)

- Fix internal error: FilterVarArrayDynamicReturnTypeExtension for
`mixed` input
([#&#8203;2338](https://togithub.com/phpstan/phpstan-src/pull/2338)),
[#&#8203;9178](https://togithub.com/phpstan/phpstan/issues/9178), thanks
[@&#8203;zonuexe](https://togithub.com/zonuexe)!

###
[`v1.10.12`](https://togithub.com/phpstan/phpstan/releases/tag/1.10.12)

[Compare
Source](https://togithub.com/phpstan/phpstan/compare/1.10.11...1.10.12)

# Major new features 🚀

- Object shapes,
[#&#8203;2923](https://togithub.com/phpstan/phpstan/issues/2923)
-
[Documentation](https://phpstan.org/writing-php-code/phpdoc-types#object-shapes)
- [Twitter
thread](https://twitter.com/OndrejMirtes/status/1643873013731844096)
about implementing it
- [phpdoc-parser
implementation](https://togithub.com/phpstan/phpdoc-parser/commit/882eabc9b6a12e25c27091a261397f9c8792e722)

# Bleeding edge 🔪

- Stricter function signature map
(phpstan/phpstan-src@06b746d,
[#&#8203;2163](https://togithub.com/phpstan/phpstan-src/pull/2163)),
[#&#8203;7239](https://togithub.com/phpstan/phpstan/issues/7239), thanks
[@&#8203;staabm](https://togithub.com/staabm)!
- Specify `Imagick` parameter types
([#&#8203;2334](https://togithub.com/phpstan/phpstan-src/pull/2334)),
thanks [@&#8203;zonuexe](https://togithub.com/zonuexe)!

*If you want to see the shape of things to come and adopt bleeding edge
features early, you can include this config file in your project's
`phpstan.neon`:*

    includes:
    	- vendor/phpstan/phpstan/conf/bleedingEdge.neon

*Of course, there are no backwards compatibility guarantees when you
include this file. The behaviour and reported errors can change in minor
versions with this file included. [Learn
more](https://phpstan.org/blog/what-is-bleeding-edge)*

# Improvements 🔧

- Improve `filter_*` array handling, support `FILTER_REQUIRE_ARRAY`
([#&#8203;2318](https://togithub.com/phpstan/phpstan-src/pull/2318)),
thanks [@&#8203;herndlm](https://togithub.com/herndlm)!
- Asymmetric `@property` types
([#&#8203;2327](https://togithub.com/phpstan/phpstan-src/pull/2327),
[#&#8203;2328](https://togithub.com/phpstan/phpstan-src/pull/2328),
[#&#8203;2329](https://togithub.com/phpstan/phpstan-src/pull/2329)),
[#&#8203;9062](https://togithub.com/phpstan/phpstan/issues/9062), thanks
[@&#8203;jtojnar](https://togithub.com/jtojnar)!
- Specify return type for `filter_input()`
([#&#8203;2010](https://togithub.com/phpstan/phpstan-src/pull/2010)),
[#&#8203;6261](https://togithub.com/phpstan/phpstan/issues/6261), thanks
[@&#8203;herndlm](https://togithub.com/herndlm)!
- Improve return type precision of `filter_input` with invalid first
args
([#&#8203;2333](https://togithub.com/phpstan/phpstan-src/pull/2333)),
thanks [@&#8203;herndlm](https://togithub.com/herndlm)!
- Allow `@property` and `@method` to override above the same class
(phpstan/phpstan-src@3467a21)
- Add `FilterVarArrayDynamicReturnTypeExtension`
([#&#8203;2257](https://togithub.com/phpstan/phpstan-src/pull/2257)),
thanks [@&#8203;zonuexe](https://togithub.com/zonuexe)!

# Bugfixes 🐛

- Fix usage of `TypeSpecifierContext::truthy()`
([#&#8203;2230](https://togithub.com/phpstan/phpstan-src/pull/2230)),
[#&#8203;3013](https://togithub.com/phpstan/phpstan/issues/3013),
[#&#8203;7686](https://togithub.com/phpstan/phpstan/issues/7686), thanks
[@&#8203;VincentLanglet](https://togithub.com/VincentLanglet)!
- Parent template type should respect child class bound when unspecified
(phpstan/phpstan-src@1017dc7),
[phpstan/phpstan-doctrine#333
- Fix bug with match expression and `treatPhpDocTypesAsCertain`
([#&#8203;2250](https://togithub.com/phpstan/phpstan-src/pull/2250)),
[#&#8203;8937](https://togithub.com/phpstan/phpstan/issues/8937), thanks
[@&#8203;VincentLanglet](https://togithub.com/VincentLanglet)!
- Generics: fix position variance of readonly-by-phpdoc properties
([#&#8203;2337](https://togithub.com/phpstan/phpstan-src/pull/2337)),
[#&#8203;9153](https://togithub.com/phpstan/phpstan/issues/9153), thanks
[@&#8203;jiripudil](https://togithub.com/jiripudil)!
- PHPStan Pro - show errors from CollectedData
(phpstan/phpstan-src@b85a961)
- Fix methods in IntersectionTypePropertyReflection
(phpstan/phpstan-src@d1c4c6d)

# Function signature fixes 🤖

- Improve Imagick method types
([#&#8203;2325](https://togithub.com/phpstan/phpstan-src/pull/2325)),
thanks [@&#8203;zonuexe](https://togithub.com/zonuexe)!

# Internals 🔍

- Switch to `cweagans/composer-patches`
([#&#8203;2307](https://togithub.com/phpstan/phpstan-src/pull/2307)),
thanks [@&#8203;herndlm](https://togithub.com/herndlm)!
- WritingToReadOnlyPropertiesRule - hook on better node
(phpstan/phpstan-src@bddf573)
- Validate usages of `assert*` functions in TypeInferenceTestCase
([#&#8203;2326](https://togithub.com/phpstan/phpstan-src/pull/2326)),
thanks [@&#8203;staabm](https://togithub.com/staabm)!

</details>

<details>
<summary>sebastianbergmann/phpunit</summary>

###
[`v9.6.7`](https://togithub.com/sebastianbergmann/phpunit/compare/9.6.6...9.6.7)

[Compare
Source](https://togithub.com/sebastianbergmann/phpunit/compare/9.6.6...9.6.7)

</details>

<details>
<summary>rectorphp/rector</summary>

###
[`v0.15.24`](https://togithub.com/rectorphp/rector/releases/tag/0.15.24):
Released Rector 0.15.24

[Compare
Source](https://togithub.com/rectorphp/rector/compare/0.15.23...0.15.24)

#### New Features 🥳

- Performance: Improve node name resolver performance
([#&#8203;3506](https://togithub.com/rectorphp/rector-src/pull/3506)),
Thanks [@&#8203;keulinho](https://togithub.com/keulinho)!
- \[CodeQuality] Add SwitchTrueToIfRector
([#&#8203;3535](https://togithub.com/rectorphp/rector-src/pull/3535))
- \[CodeQuality] Add cast scalar support on
ReturnTypeFromStrictScalarRector
([#&#8203;3544](https://togithub.com/rectorphp/rector-src/pull/3544))
- Improve ArraySpreadInsteadOfArrayMergeRector
([#&#8203;3551](https://togithub.com/rectorphp/rector-src/pull/3551)),
Thanks [@&#8203;yguedidi](https://togithub.com/yguedidi)!
- Performance: reduce parent attribute usage on BetterNodeFinder
([#&#8203;3504](https://togithub.com/rectorphp/rector-src/pull/3504))
- Performance: using findFirst() when possible at BetterNodeFinder
([#&#8203;3505](https://togithub.com/rectorphp/rector-src/pull/3505))
- Performance: use direct find() instead of lookup all nodes then filter
on BetterNodeFinder
([#&#8203;3507](https://togithub.com/rectorphp/rector-src/pull/3507))
- Performance: Use faster hashing algo for cache key generation
([#&#8203;3508](https://togithub.com/rectorphp/rector-src/pull/3508)),
Thanks [@&#8203;keulinho](https://togithub.com/keulinho)!

<br>

#### Bugfixes 🐛

- Add not null compare to FlipTypeControlToUseExclusiveTypeRector
([#&#8203;3513](https://togithub.com/rectorphp/rector-src/pull/3513))
- \[CodeQuality] Skip static class const fetch on
InlineConstructorDefaultToPropertyRector
([#&#8203;3510](https://togithub.com/rectorphp/rector-src/pull/3510))
- \[CodingStyle] Make EncapsedStringsToSprintfRector work with two
string concat
([#&#8203;3515](https://togithub.com/rectorphp/rector-src/pull/3515))
- \[CodeQuality] Handle multiple ifs on
SimplifyIfExactValueReturnValueRector
([#&#8203;3527](https://togithub.com/rectorphp/rector-src/pull/3527))
- \[NodeManipulator] Reduce parent attribute usage on
VariableManipulator
([#&#8203;3528](https://togithub.com/rectorphp/rector-src/pull/3528))
- \[NodeTypeResolver] Make NodeTraverser as property on
PHPStanNodeScopeResolver
([#&#8203;3533](https://togithub.com/rectorphp/rector-src/pull/3533))
- \[NodeTypeResolver] Make NodeTraverser as property on
NodeScopeAndMetadataDecorator
([#&#8203;3532](https://togithub.com/rectorphp/rector-src/pull/3532))
- \[NodeAnalyzer] Use PHPStan ClassReflection to detect anonymous class
on ClassAnalyzer
([#&#8203;3543](https://togithub.com/rectorphp/rector-src/pull/3543))
- \[Php81] Merge attributes on NewInInitializerRector
([#&#8203;3546](https://togithub.com/rectorphp/rector-src/pull/3546))
- \[Php81] Handle assign op append on ReadOnlyPropertyRector
([#&#8203;3552](https://togithub.com/rectorphp/rector-src/pull/3552))
- \[CodeQuality] Skip empty cases on SwitchTrueToIfRector
([#&#8203;3556](https://togithub.com/rectorphp/rector-src/pull/3556))
- RemoveNonExistingVarAnnotationRector: Allow return annotations
([#&#8203;3534](https://togithub.com/rectorphp/rector-src/pull/3534)),
Thanks [@&#8203;jlherren](https://togithub.com/jlherren)!
- \[PostRector] Skip remove unused used at
[@&#8203;see](https://togithub.com/see) for Generic tag
([#&#8203;3562](https://togithub.com/rectorphp/rector-src/pull/3562))
- \[PostRector] Skip remove unused use on used as ConstFetchNode, eg:
TypeKind::\*
([#&#8203;3560](https://togithub.com/rectorphp/rector-src/pull/3560))

<br>

#### Removed 💀

- \[CodeQuality] Remove next node attribute usage on
SimplifyIfExactValueReturnValueRector
([#&#8203;3511](https://togithub.com/rectorphp/rector-src/pull/3511))
- \[CodingStyle] Remove previous node attribute on
WrapEncapsedVariableInCurlyBracesRector
([#&#8203;3512](https://togithub.com/rectorphp/rector-src/pull/3512))
- \[CodeQuality] Remove next node attribute usage on
SimplifyIfNotNullReturnRector
([#&#8203;3517](https://togithub.com/rectorphp/rector-src/pull/3517))
- Remove deprecated [@&#8203;noRector](https://togithub.com/noRector)
warning
([#&#8203;3518](https://togithub.com/rectorphp/rector-src/pull/3518))
- \[CodingStyle] Remove next node attribute on
NewlineAfterStatementRector
([#&#8203;3525](https://togithub.com/rectorphp/rector-src/pull/3525))
- \[Privatization] Remove parent attribute usage on
PrivatizeFinalClassMethodRector
([#&#8203;3526](https://togithub.com/rectorphp/rector-src/pull/3526))
- \[NodeTypeResolver] Remove
NodeScopeAndMetadataDecorator::decorateStmtsFromString() method
([#&#8203;3530](https://togithub.com/rectorphp/rector-src/pull/3530))
- \[DeadCode] Remove previous attribute usage on
RemoveDeadConditionAboveReturnRector
([#&#8203;3538](https://togithub.com/rectorphp/rector-src/pull/3538))
- \[Php70] Remove previous attribute usage on
ReduceMultipleDefaultSwitchRector
([#&#8203;3537](https://togithub.com/rectorphp/rector-src/pull/3537))
- \[CodingStyle] Remove parent attribute usage on
RemoveFinalFromConstRector
([#&#8203;3536](https://togithub.com/rectorphp/rector-src/pull/3536))
- \[CodingStyle] Remove previous node attribute on
TernaryConditionVariableAssignmentRector
([#&#8203;3540](https://togithub.com/rectorphp/rector-src/pull/3540))
- \[DeadCode] Remove previous and parent attribute usage on
RemoveNullPropertyInitializationRector
([#&#8203;3541](https://togithub.com/rectorphp/rector-src/pull/3541))
- \[DeadCode] Remove property comment same line on
RemoveUnusedPrivatePropertyRector
([#&#8203;3547](https://togithub.com/rectorphp/rector-src/pull/3547))
- \[PSR4] Remove clone $node on
NormalizeNamespaceByPSR4ComposerAutoloadRector
([#&#8203;3553](https://togithub.com/rectorphp/rector-src/pull/3553))
- \[PSR4] Remove clone $node on PseudoNamespaceToNamespaceRector
([#&#8203;3554](https://togithub.com/rectorphp/rector-src/pull/3554))
- \[Tests] Remove RunTestsInSeparateProcesses in rules-tests
([#&#8203;3555](https://togithub.com/rectorphp/rector-src/pull/3555))
- \[NodeRemover] Use return null after $this->removeNode()
([#&#8203;3558](https://togithub.com/rectorphp/rector-src/pull/3558))
- \[Php73] Remove next node attribute usage on ArrayKeyFirstLastRector
([#&#8203;3559](https://togithub.com/rectorphp/rector-src/pull/3559))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config help](https://togithub.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://app.renovatebot.com/dashboard#github/ben-challis/sql-migrations).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4zMi4yIiwidXBkYXRlZEluVmVyIjoiMzUuNDAuMCJ9-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Ben Challis <ben@lendable.co.uk>
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants