Skip to content

Commit

Permalink
Document collected/iterated type using Psalm template
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Dec 2, 2022
1 parent 70de842 commit a653302
Show file tree
Hide file tree
Showing 24 changed files with 46 additions and 93 deletions.
93 changes: 0 additions & 93 deletions .psalm/baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1179,54 +1179,22 @@
<code>$this-&gt;printer !== null</code>
</RedundantConditionGivenDocblockType>
</file>
<file src="src/TextUI/XmlConfiguration/CodeCoverage/Filter/DirectoryCollection.php">
<MissingTemplateParam occurrences="1">
<code>IteratorAggregate</code>
</MissingTemplateParam>
</file>
<file src="src/TextUI/XmlConfiguration/CodeCoverage/Filter/DirectoryCollectionIterator.php">
<MissingTemplateParam occurrences="1">
<code>Iterator</code>
</MissingTemplateParam>
<PropertyNotSetInConstructor occurrences="1">
<code>$position</code>
</PropertyNotSetInConstructor>
</file>
<file src="src/TextUI/XmlConfiguration/Filesystem/DirectoryCollection.php">
<MissingTemplateParam occurrences="1">
<code>IteratorAggregate</code>
</MissingTemplateParam>
</file>
<file src="src/TextUI/XmlConfiguration/Filesystem/DirectoryCollectionIterator.php">
<MissingTemplateParam occurrences="1">
<code>Iterator</code>
</MissingTemplateParam>
<PropertyNotSetInConstructor occurrences="1">
<code>$position</code>
</PropertyNotSetInConstructor>
</file>
<file src="src/TextUI/XmlConfiguration/Filesystem/FileCollection.php">
<MissingTemplateParam occurrences="1">
<code>IteratorAggregate</code>
</MissingTemplateParam>
</file>
<file src="src/TextUI/XmlConfiguration/Filesystem/FileCollectionIterator.php">
<MissingTemplateParam occurrences="1">
<code>Iterator</code>
</MissingTemplateParam>
<PropertyNotSetInConstructor occurrences="1">
<code>$position</code>
</PropertyNotSetInConstructor>
</file>
<file src="src/TextUI/XmlConfiguration/Group/GroupCollection.php">
<MissingTemplateParam occurrences="1">
<code>IteratorAggregate</code>
</MissingTemplateParam>
</file>
<file src="src/TextUI/XmlConfiguration/Group/GroupCollectionIterator.php">
<MissingTemplateParam occurrences="1">
<code>Iterator</code>
</MissingTemplateParam>
<PropertyNotSetInConstructor occurrences="1">
<code>$position</code>
</PropertyNotSetInConstructor>
Expand Down Expand Up @@ -1373,28 +1341,12 @@
<code>value</code>
</MissingReturnType>
</file>
<file src="src/TextUI/XmlConfiguration/PHP/ConstantCollection.php">
<MissingTemplateParam occurrences="1">
<code>IteratorAggregate</code>
</MissingTemplateParam>
</file>
<file src="src/TextUI/XmlConfiguration/PHP/ConstantCollectionIterator.php">
<MissingTemplateParam occurrences="1">
<code>Iterator</code>
</MissingTemplateParam>
<PropertyNotSetInConstructor occurrences="1">
<code>$position</code>
</PropertyNotSetInConstructor>
</file>
<file src="src/TextUI/XmlConfiguration/PHP/IniSettingCollection.php">
<MissingTemplateParam occurrences="1">
<code>IteratorAggregate</code>
</MissingTemplateParam>
</file>
<file src="src/TextUI/XmlConfiguration/PHP/IniSettingCollectionIterator.php">
<MissingTemplateParam occurrences="1">
<code>Iterator</code>
</MissingTemplateParam>
<PropertyNotSetInConstructor occurrences="1">
<code>$position</code>
</PropertyNotSetInConstructor>
Expand All @@ -1407,28 +1359,12 @@
<code>value</code>
</MissingReturnType>
</file>
<file src="src/TextUI/XmlConfiguration/PHP/VariableCollection.php">
<MissingTemplateParam occurrences="1">
<code>IteratorAggregate</code>
</MissingTemplateParam>
</file>
<file src="src/TextUI/XmlConfiguration/PHP/VariableCollectionIterator.php">
<MissingTemplateParam occurrences="1">
<code>Iterator</code>
</MissingTemplateParam>
<PropertyNotSetInConstructor occurrences="1">
<code>$position</code>
</PropertyNotSetInConstructor>
</file>
<file src="src/TextUI/XmlConfiguration/PHPUnit/ExtensionCollection.php">
<MissingTemplateParam occurrences="1">
<code>IteratorAggregate</code>
</MissingTemplateParam>
</file>
<file src="src/TextUI/XmlConfiguration/PHPUnit/ExtensionCollectionIterator.php">
<MissingTemplateParam occurrences="1">
<code>Iterator</code>
</MissingTemplateParam>
<PropertyNotSetInConstructor occurrences="1">
<code>$position</code>
</PropertyNotSetInConstructor>
Expand Down Expand Up @@ -1463,41 +1399,17 @@
<code>(string) $this-&gt;testSuiteLoaderFile</code>
</RedundantCastGivenDocblockType>
</file>
<file src="src/TextUI/XmlConfiguration/TestSuite/TestDirectoryCollection.php">
<MissingTemplateParam occurrences="1">
<code>IteratorAggregate</code>
</MissingTemplateParam>
</file>
<file src="src/TextUI/XmlConfiguration/TestSuite/TestDirectoryCollectionIterator.php">
<MissingTemplateParam occurrences="1">
<code>Iterator</code>
</MissingTemplateParam>
<PropertyNotSetInConstructor occurrences="1">
<code>$position</code>
</PropertyNotSetInConstructor>
</file>
<file src="src/TextUI/XmlConfiguration/TestSuite/TestFileCollection.php">
<MissingTemplateParam occurrences="1">
<code>IteratorAggregate</code>
</MissingTemplateParam>
</file>
<file src="src/TextUI/XmlConfiguration/TestSuite/TestFileCollectionIterator.php">
<MissingTemplateParam occurrences="1">
<code>Iterator</code>
</MissingTemplateParam>
<PropertyNotSetInConstructor occurrences="1">
<code>$position</code>
</PropertyNotSetInConstructor>
</file>
<file src="src/TextUI/XmlConfiguration/TestSuite/TestSuiteCollection.php">
<MissingTemplateParam occurrences="1">
<code>IteratorAggregate</code>
</MissingTemplateParam>
</file>
<file src="src/TextUI/XmlConfiguration/TestSuite/TestSuiteCollectionIterator.php">
<MissingTemplateParam occurrences="1">
<code>Iterator</code>
</MissingTemplateParam>
<PropertyNotSetInConstructor occurrences="1">
<code>$position</code>
</PropertyNotSetInConstructor>
Expand Down Expand Up @@ -1792,11 +1704,6 @@
<code>(string) $entry-&gt;getAttribute('key')</code>
</RedundantCast>
</file>
<file src="src/Util/Xml/SnapshotNodeList.php">
<MissingTemplateParam occurrences="1">
<code>IteratorAggregate</code>
</MissingTemplateParam>
</file>
<file src="src/Util/XmlTestListRenderer.php">
<ArgumentTypeCoercion occurrences="1">
<code>$suite-&gt;getIterator()</code>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*
* @psalm-immutable
*
* @template-implements IteratorAggregate<int, Directory>
*/
final class DirectoryCollection implements Countable, IteratorAggregate
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

/**
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*
* @template-implements Iterator<int, Directory>
*/
final class DirectoryCollectionIterator implements Countable, Iterator
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*
* @psalm-immutable
*
* @template-implements IteratorAggregate<int, Directory>
*/
final class DirectoryCollection implements Countable, IteratorAggregate
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

/**
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*
* @template-implements Iterator<int, Directory>
*/
final class DirectoryCollectionIterator implements Countable, Iterator
{
Expand Down
2 changes: 2 additions & 0 deletions src/TextUI/XmlConfiguration/Filesystem/FileCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*
* @psalm-immutable
*
* @template-implements IteratorAggregate<int, File>
*/
final class FileCollection implements Countable, IteratorAggregate
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

/**
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*
* @template-implements Iterator<int, File>
*/
final class FileCollectionIterator implements Countable, Iterator
{
Expand Down
2 changes: 2 additions & 0 deletions src/TextUI/XmlConfiguration/Group/GroupCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*
* @psalm-immutable
*
* @template-implements IteratorAggregate<int, Group>
*/
final class GroupCollection implements IteratorAggregate
{
Expand Down
2 changes: 2 additions & 0 deletions src/TextUI/XmlConfiguration/Group/GroupCollectionIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

/**
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*
* @template-implements Iterator<int, Group>
*/
final class GroupCollectionIterator implements Countable, Iterator
{
Expand Down
2 changes: 2 additions & 0 deletions src/TextUI/XmlConfiguration/PHP/ConstantCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*
* @psalm-immutable
*
* @template-implements IteratorAggregate<int, Constant>
*/
final class ConstantCollection implements Countable, IteratorAggregate
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

/**
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*
* @template-implements Iterator<int, Constant>
*/
final class ConstantCollectionIterator implements Countable, Iterator
{
Expand Down
2 changes: 2 additions & 0 deletions src/TextUI/XmlConfiguration/PHP/IniSettingCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*
* @psalm-immutable
*
* @template-implements IteratorAggregate<int, IniSetting>
*/
final class IniSettingCollection implements Countable, IteratorAggregate
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

/**
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*
* @template-implements Iterator<int, IniSetting>
*/
final class IniSettingCollectionIterator implements Countable, Iterator
{
Expand Down
2 changes: 2 additions & 0 deletions src/TextUI/XmlConfiguration/PHP/VariableCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*
* @psalm-immutable
*
* @template-implements IteratorAggregate<int, Variable>
*/
final class VariableCollection implements Countable, IteratorAggregate
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

/**
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*
* @template-implements Iterator<int, Variable>
*/
final class VariableCollectionIterator implements Countable, Iterator
{
Expand Down
2 changes: 2 additions & 0 deletions src/TextUI/XmlConfiguration/PHPUnit/ExtensionCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*
* @psalm-immutable
*
* @template-implements IteratorAggregate<int, Extension>
*/
final class ExtensionCollection implements IteratorAggregate
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

/**
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*
* @template-implements Iterator<int, Extension>
*/
final class ExtensionCollectionIterator implements Countable, Iterator
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*
* @psalm-immutable
*
* @template-implements IteratorAggregate<int, TestDirectory>
*/
final class TestDirectoryCollection implements Countable, IteratorAggregate
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

/**
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*
* @template-implements Iterator<int, TestDirectory>
*/
final class TestDirectoryCollectionIterator implements Countable, Iterator
{
Expand Down
2 changes: 2 additions & 0 deletions src/TextUI/XmlConfiguration/TestSuite/TestFileCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*
* @psalm-immutable
*
* @template-implements IteratorAggregate<int, TestFile>
*/
final class TestFileCollection implements Countable, IteratorAggregate
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

/**
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*
* @template-implements Iterator<int, TestFile>
*/
final class TestFileCollectionIterator implements Countable, Iterator
{
Expand Down
2 changes: 2 additions & 0 deletions src/TextUI/XmlConfiguration/TestSuite/TestSuiteCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*
* @psalm-immutable
*
* @template-implements IteratorAggregate<int, TestSuite>
*/
final class TestSuiteCollection implements Countable, IteratorAggregate
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

/**
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*
* @template-implements Iterator<int, TestSuite>
*/
final class TestSuiteCollectionIterator implements Countable, Iterator
{
Expand Down
2 changes: 2 additions & 0 deletions src/Util/Xml/SnapshotNodeList.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

/**
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*
* @template-implements IteratorAggregate<int, DOMNode>
*/
final class SnapshotNodeList implements Countable, IteratorAggregate
{
Expand Down

0 comments on commit a653302

Please sign in to comment.