Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions extension.neon
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ parameters:
constantHassers: true
console_application_loader: null
consoleApplicationLoader: null
featureToggles:
skipCheckGenericClasses:
- Symfony\Component\OptionsResolver\Options
stubFiles:
- stubs/Php/Stringable.stub
- stubs/Psr/Cache/CacheItemInterface.stub
Expand Down Expand Up @@ -38,6 +41,7 @@ parameters:
- stubs/Symfony/Component/HttpFoundation/Session.stub
- stubs/Symfony/Component/Messenger/StampInterface.stub
- stubs/Symfony/Component/Messenger/Envelope.stub
- stubs/Symfony/Component/OptionsResolver/Options.stub
- stubs/Symfony/Component/Process/Process.stub
- stubs/Symfony/Component/PropertyAccess/PropertyPathInterface.stub
- stubs/Symfony/Component/Security/Acl/Model/AclInterface.stub
Expand Down
41 changes: 41 additions & 0 deletions stubs/Symfony/Component/OptionsResolver/Options.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

namespace Symfony\Component\OptionsResolver;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs to be registered in stubFiles in extension.neon.

Also since you're making Options class generic, you need to add it to parameters.featureToggles.skipCheckGenericClasses, similarly to here: https://github.com/phpstan/phpstan-src/blob/74228e6f930c9a0e6ca9461557a6d40b92cf4e91/conf/config.neon#L23-L33 (this list will be purged with the next major version).


/**
* @template TArray of array
* @extends \ArrayAccess<key-of<TArray>, value-of<TArray>>
*/
interface Options extends \ArrayAccess, \Countable
{
/**
* @param key-of<TArray> $offset
*
* @return bool
*/
public function offsetExists($offset);

/**
* @template TOffset of key-of<TArray>
* @param TOffset $offset
* @return TArray[TOffset]
*/
public function offsetGet($offset);

/**
* @template TOffset of key-of<TArray>
* @param TOffset|null $offset
* @param TArray[TOffset] $value
*
* @return void
*/
public function offsetSet($offset, $value);

/**
* @template TOffset of key-of<TArray>
* @param TOffset $offset
*
* @return void
*/
public function offsetUnset($offset);
}