Skip to content

Commit

Permalink
Document fluent interfaces (#9009)
Browse files Browse the repository at this point in the history
  • Loading branch information
derrabus authored Sep 13, 2021
1 parent 6371081 commit 334ca18
Show file tree
Hide file tree
Showing 13 changed files with 112 additions and 112 deletions.
30 changes: 15 additions & 15 deletions lib/Doctrine/ORM/AbstractQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public function __construct(EntityManagerInterface $em)
*
* @param bool $cacheable
*
* @return static This query instance.
* @return $this
*/
public function setCacheable($cacheable)
{
Expand All @@ -201,7 +201,7 @@ public function isCacheable()
/**
* @param string $cacheRegion
*
* @return static This query instance.
* @return $this
*/
public function setCacheRegion($cacheRegion)
{
Expand Down Expand Up @@ -241,7 +241,7 @@ public function getLifetime()
*
* @param int $lifetime
*
* @return static This query instance.
* @return $this
*/
public function setLifetime($lifetime)
{
Expand All @@ -261,7 +261,7 @@ public function getCacheMode()
/**
* @param int $cacheMode
*
* @return static This query instance.
* @return $this
*/
public function setCacheMode($cacheMode)
{
Expand Down Expand Up @@ -342,7 +342,7 @@ static function (Query\Parameter $parameter) use ($key): bool {
* @param ArrayCollection|mixed[] $parameters
* @psalm-param ArrayCollection<int, Parameter>|mixed[] $parameters
*
* @return static This query instance.
* @return $this
*/
public function setParameters($parameters)
{
Expand Down Expand Up @@ -372,7 +372,7 @@ public function setParameters($parameters)
* the type conversion of this type. This is usually not needed for
* strings and numeric types.
*
* @return static This query instance.
* @return $this
*/
public function setParameter($key, $value, $type = null)
{
Expand Down Expand Up @@ -479,7 +479,7 @@ private function processArrayParameterValue(array $value): array
/**
* Sets the ResultSetMapping that should be used for hydration.
*
* @return static This query instance.
* @return $this
*/
public function setResultSetMapping(Query\ResultSetMapping $rsm)
{
Expand Down Expand Up @@ -524,7 +524,7 @@ private function translateNamespaces(Query\ResultSetMapping $rsm): void
* some form of caching with UnitOfWork registration you should use
* {@see AbstractQuery::setResultCacheProfile()}.
*
* @return static This query instance.
* @return $this
*
* @example
* $lifetime = 100;
Expand Down Expand Up @@ -684,7 +684,7 @@ public function getResultCacheDriver()
* @param int $lifetime How long the cache entry is valid, in seconds.
* @param string $resultCacheId ID to use for the cache entry.
*
* @return static This query instance.
* @return $this
*/
public function useResultCache($useCache, $lifetime = null, $resultCacheId = null)
{
Expand All @@ -700,7 +700,7 @@ public function useResultCache($useCache, $lifetime = null, $resultCacheId = nul
* @param int|null $lifetime How long the cache entry is valid, in seconds.
* @param string|null $resultCacheId ID to use for the cache entry.
*
* @return static This query instance.
* @return $this
*/
public function enableResultCache(?int $lifetime = null, ?string $resultCacheId = null): self
{
Expand All @@ -713,7 +713,7 @@ public function enableResultCache(?int $lifetime = null, ?string $resultCacheId
/**
* Disables caching of the results of this query.
*
* @return static This query instance.
* @return $this
*/
public function disableResultCache(): self
{
Expand Down Expand Up @@ -775,7 +775,7 @@ public function getResultCacheLifetime()
*
* @param bool $expire Whether or not to force resultset cache expiration.
*
* @return static This query instance.
* @return $this
*/
public function expireResultCache($expire = true)
{
Expand Down Expand Up @@ -811,7 +811,7 @@ public function getQueryCacheProfile()
* @param string $assocName
* @param int $fetchMode
*
* @return static This query instance.
* @return $this
*/
public function setFetchMode($class, $assocName, $fetchMode)
{
Expand All @@ -830,7 +830,7 @@ public function setFetchMode($class, $assocName, $fetchMode)
* @param string|int $hydrationMode Doctrine processing mode to be used during hydration process.
* One of the Query::HYDRATE_* constants.
*
* @return static This query instance.
* @return $this
*/
public function setHydrationMode($hydrationMode)
{
Expand Down Expand Up @@ -987,7 +987,7 @@ public function getSingleScalarResult()
* @param string $name The name of the hint.
* @param mixed $value The value of the hint.
*
* @return static This query instance.
* @return $this
*/
public function setHint($name, $value)
{
Expand Down
28 changes: 14 additions & 14 deletions lib/Doctrine/ORM/Mapping/Builder/AssociationBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function __construct(ClassMetadataBuilder $builder, array $mapping, $type
/**
* @param string $fieldName
*
* @return static
* @return $this
*/
public function mappedBy($fieldName)
{
Expand All @@ -47,7 +47,7 @@ public function mappedBy($fieldName)
/**
* @param string $fieldName
*
* @return static
* @return $this
*/
public function inversedBy($fieldName)
{
Expand All @@ -57,7 +57,7 @@ public function inversedBy($fieldName)
}

/**
* @return static
* @return $this
*/
public function cascadeAll()
{
Expand All @@ -67,7 +67,7 @@ public function cascadeAll()
}

/**
* @return static
* @return $this
*/
public function cascadePersist()
{
Expand All @@ -77,7 +77,7 @@ public function cascadePersist()
}

/**
* @return static
* @return $this
*/
public function cascadeRemove()
{
Expand All @@ -87,7 +87,7 @@ public function cascadeRemove()
}

/**
* @return static
* @return $this
*/
public function cascadeMerge()
{
Expand All @@ -97,7 +97,7 @@ public function cascadeMerge()
}

/**
* @return static
* @return $this
*/
public function cascadeDetach()
{
Expand All @@ -107,7 +107,7 @@ public function cascadeDetach()
}

/**
* @return static
* @return $this
*/
public function cascadeRefresh()
{
Expand All @@ -117,7 +117,7 @@ public function cascadeRefresh()
}

/**
* @return static
* @return $this
*/
public function fetchExtraLazy()
{
Expand All @@ -127,7 +127,7 @@ public function fetchExtraLazy()
}

/**
* @return static
* @return $this
*/
public function fetchEager()
{
Expand All @@ -137,7 +137,7 @@ public function fetchEager()
}

/**
* @return static
* @return $this
*/
public function fetchLazy()
{
Expand All @@ -156,7 +156,7 @@ public function fetchLazy()
* @param string|null $onDelete
* @param string|null $columnDef
*
* @return static
* @return $this
*/
public function addJoinColumn($columnName, $referencedColumnName, $nullable = true, $unique = false, $onDelete = null, $columnDef = null)
{
Expand All @@ -175,7 +175,7 @@ public function addJoinColumn($columnName, $referencedColumnName, $nullable = tr
/**
* Sets field as primary key.
*
* @return static
* @return $this
*/
public function makePrimaryKey()
{
Expand All @@ -187,7 +187,7 @@ public function makePrimaryKey()
/**
* Removes orphan entities when detached from their parent.
*
* @return static
* @return $this
*/
public function orphanRemoval()
{
Expand Down
Loading

0 comments on commit 334ca18

Please sign in to comment.