Skip to content

Commit

Permalink
more annotation fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Hedzer committed Jun 12, 2024
1 parent bf4251f commit b04412b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
7 changes: 4 additions & 3 deletions lib/Doctrine/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
* @template T of \Doctrine_Record
* @implements \IteratorAggregate<int, T>
* @implements \ArrayAccess<int, T>
*
* @method T offsetGet(int|string $offset)
*/
class Doctrine_Collection extends Doctrine_Access implements Countable, IteratorAggregate
{
Expand Down Expand Up @@ -444,8 +446,7 @@ public function count(): int
* Set a Doctrine_Record instance to the collection
*
* @param integer $key
* @param Doctrine_Record $record
* @phpstan-param T $record
* @param T $record
* @return void
*/
public function set($key, $record)
Expand Down Expand Up @@ -756,7 +757,7 @@ public function toHierarchy()
}

// Trees mapped
/** @phpstan-var Doctrine_Collection<T> */
/** @var Doctrine_Collection<T> $trees */
$trees = new Doctrine_Collection($table);
$l = 0;

Expand Down
12 changes: 7 additions & 5 deletions lib/Doctrine/Record.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
* @link www.doctrine-project.org
* @since 1.0
* @version $Revision: 7673 $
*
* @implements ArrayAccess
*/
abstract class Doctrine_Record extends Doctrine_Record_Abstract implements Countable, IteratorAggregate
{
Expand Down Expand Up @@ -94,7 +96,7 @@ abstract class Doctrine_Record extends Doctrine_Record_Abstract implements Count
protected $_node;

/**
* @var integer $_id the primary keys of this object
* @var integer|array $_id the primary keys of this object
*/
protected $_id = array();

Expand Down Expand Up @@ -1950,8 +1952,8 @@ public function merge($data, $deep = true)
* imports data from a php array
*
* @link http://www.doctrine-project.org/documentation/manual/1_1/en/working-with-models
* @param string $array array of data, see link for documentation
* @param bool $deep whether or not to act on relations
* @param string|array $array array of data, see link for documentation
* @param bool $deep whether or not to act on relations
*/
public function fromArray(array $array, $deep = true)
{
Expand Down Expand Up @@ -2052,8 +2054,8 @@ public function synchronizeWithArray(array $array, $deep = true)
/**
* imports data from a chosen format in the current instance
*
* @param string $type Format type: xml, yml, json
* @param string $data Data to be parsed and imported
* @param string $type Format type: xml, yml, json
* @param string|array $data Data to be parsed and imported
*/
public function importFrom($type, $data, $deep = true)
{
Expand Down

0 comments on commit b04412b

Please sign in to comment.