Skip to content

Commit

Permalink
Stubs for setParameters() methods that accept arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Jul 18, 2020
1 parent ecc4aec commit 71a3d2d
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 0 deletions.
5 changes: 5 additions & 0 deletions extension.neon
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ parameters:
- stubs/Persistence/ObjectManagerDecorator.stub
- stubs/Persistence/ObjectRepository.stub
- stubs/RepositoryFactory.stub
- stubs/Collections/ArrayCollection.stub
- stubs/Collections/Collection.stub
- stubs/Collections/Selectable.stub
- stubs/ORM/QueryBuilder.stub
- stubs/ORM/AbstractQuery.stub

parametersSchema:
doctrine: structure([
Expand Down
14 changes: 14 additions & 0 deletions stubs/Collections/ArrayCollection.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

namespace Doctrine\Common\Collections;

/**
* @template TKey
* @template T
* @implements Collection<TKey,T>
* @implements Selectable<TKey,T>
*/
class ArrayCollection implements Collection, Selectable
{

}
18 changes: 18 additions & 0 deletions stubs/Collections/Collection.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

namespace Doctrine\Common\Collections;

use ArrayAccess;
use Countable;
use IteratorAggregate;

/**
* @template TKey
* @template T
* @extends IteratorAggregate<TKey, T>
* @extends ArrayAccess<TKey|null, T>
*/
interface Collection extends Countable, IteratorAggregate, ArrayAccess
{

}
12 changes: 12 additions & 0 deletions stubs/Collections/Selectable.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

namespace Doctrine\Common\Collections;

/**
* @template TKey
* @template T
*/
interface Selectable
{

}
19 changes: 19 additions & 0 deletions stubs/ORM/AbstractQuery.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

namespace Doctrine\ORM;

use Doctrine\Common\Collections\ArrayCollection;

abstract class AbstractQuery
{

/**
* @param ArrayCollection<mixed, mixed>|array<mixed> $parameters
* @return static
*/
public function setParameters($parameters)
{

}

}
17 changes: 17 additions & 0 deletions stubs/ORM/QueryBuilder.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

namespace Doctrine\ORM;

class QueryBuilder
{

/**
* @param \Doctrine\Common\Collections\ArrayCollection<mixed, mixed>|array<mixed> $parameters
* @return static
*/
public function setParameters($parameters)
{

}

}

0 comments on commit 71a3d2d

Please sign in to comment.