Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark methods and classes as internal #1960

Merged
merged 1 commit into from
Mar 14, 2019
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
10 changes: 10 additions & 0 deletions UPGRADE-2.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -297,3 +297,13 @@ ocramius. If you are checking for proxies, the following changed:
* The `isScheduledForDirtyCheck` and `scheduleForDirtyCheck` methods have been
renamed to `isScheduledForSynchronization` and `scheduleForSynchronization`,
respectively.

## Internal classes and methods

Number of public methods and classes saw an `@internal` annotation added. This
marks places which are considered private to ODM but can not become ones due to
language limitations. Those methods can still be used (at your own risk) however
the backward compatibility promise for them is relaxed: we reserve the right to
change internal method's signatures and/or remove them altogether in *minor*
releases. Should such change be made, a note shall be included in the `UPGRADE.md`
file describing changes contained in the release.
2 changes: 2 additions & 0 deletions lib/Doctrine/ODM/MongoDB/Hydrator/HydratorFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ public function __construct(DocumentManager $dm, EventManager $evm, ?string $hyd

/**
* Sets the UnitOfWork instance.
*
* @internal
*/
public function setUnitOfWork(UnitOfWork $uow) : void
alcaeus marked this conversation as resolved.
Show resolved Hide resolved
{
Expand Down
9 changes: 6 additions & 3 deletions lib/Doctrine/ODM/MongoDB/Mapping/ClassMetadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -573,8 +573,9 @@ public function isIdentifier($fieldName) : bool
}

/**
* INTERNAL:
* Sets the mapped identifier field of this class.
*
* @internal
*/
public function setIdentifier(?string $identifier) : void
{
Expand Down Expand Up @@ -1249,9 +1250,10 @@ public function mapManyReference(array $mapping) : void
}

/**
* INTERNAL:
* Adds a field mapping without completing/validating it.
* This is mainly used to add inherited field mappings to derived classes.
*
* @internal
*/
public function addInheritedFieldMapping(array $fieldMapping) : void
{
Expand All @@ -1265,10 +1267,11 @@ public function addInheritedFieldMapping(array $fieldMapping) : void
}

/**
* INTERNAL:
* Adds an association mapping without completing/validating it.
* This is mainly used to add inherited association mappings to derived classes.
*
* @internal
*
* @throws MappingException
*/
public function addInheritedAssociationMapping(array $mapping) : void
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/ODM/MongoDB/Mapping/ClassMetadataFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
* The ClassMetadataFactory is used to create ClassMetadata objects that contain all the
* metadata mapping informations of a class which describes how a class should be mapped
* to a document database.
*
* @internal
*/
class ClassMetadataFactory extends AbstractClassMetadataFactory
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,12 @@ public function isDirty();
public function setDirty($dirty);

/**
* INTERNAL:
Copy link
Member Author

Choose a reason for hiding this comment

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

Entire interface is marked as internal

* Sets the collection's owning entity together with the AssociationMapping that
* describes the association between the owner and the elements of the collection.
*/
public function setOwner(object $document, array $mapping);

/**
* INTERNAL:
* Tells this collection to take a snapshot of its current state reindexing
* itself numerically if using save strategy that is enforcing BSON array.
* Reindexing is safe as snapshot is taken only after synchronizing collection
Expand All @@ -87,52 +85,43 @@ public function setOwner(object $document, array $mapping);
public function takeSnapshot();

/**
* INTERNAL:
* Clears the internal snapshot information and sets isDirty to true if the collection
* has elements.
*/
public function clearSnapshot();

/**
* INTERNAL:
* Returns the last snapshot of the elements in the collection.
*
* @return array The last snapshot of the elements.
*/
public function getSnapshot();

/**
* INTERNAL:
* getDeleteDiff
*
* @return array
*/
public function getDeleteDiff();

/**
* INTERNAL: get objects that were removed, unlike getDeleteDiff this doesn't care about indices.
* Get objects that were removed, unlike getDeleteDiff this doesn't care about indices.
*
* @return array
*/
public function getDeletedDocuments();

/**
* INTERNAL:
* getInsertDiff
*
* @return array
*/
public function getInsertDiff();

/**
* INTERNAL: get objects that were added, unlike getInsertDiff this doesn't care about indices.
* Get objects that were added, unlike getInsertDiff this doesn't care about indices.
*
* @return array
*/
public function getInsertedDocuments();

/**
* INTERNAL:
* Gets the collection owner.
*/
public function getOwner() : ?object;
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/ODM/MongoDB/Persisters/CollectionPersister.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
* removed, CollectionPersister::update() will be called, which may set the
* entire collection or delete/insert individual elements, depending on the
* mapping strategy.
*
* @internal
*/
class CollectionPersister
{
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/ODM/MongoDB/Persisters/DocumentPersister.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@

/**
* The DocumentPersister is responsible for persisting documents.
*
* @internal
*/
class DocumentPersister
{
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/ODM/MongoDB/Persisters/PersistenceBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
* PersistenceBuilder builds the queries used by the persisters to update and insert
* documents when a DocumentManager is flushed. It uses the changeset information in the
* UnitOfWork to build queries using atomic operators like $set, $unset, etc.
*
* @internal
*/
class PersistenceBuilder
{
Expand Down
3 changes: 3 additions & 0 deletions lib/Doctrine/ODM/MongoDB/Proxy/FileLocator.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
use function mkdir;
use function realpath;

/**
* @internal
*/
final class FileLocator extends BaseFileLocator
{
public function __construct(string $proxiesDirectory)
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/ODM/MongoDB/Query/QueryExpressionVisitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

/**
* Converts Collection expressions to query expressions.
*
* @internal
*/
class QueryExpressionVisitor extends ExpressionVisitor
{
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/ODM/MongoDB/Query/ReferencePrimer.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
*
* Priming can only be used for the owning side side of a relationship, since
* the referenced identifiers are not immediately available on an inverse side.
*
* @internal
*/
class ReferencePrimer
{
Expand Down
Loading