Skip to content

Commit

Permalink
Merge 7176dd4 into 86e4a27
Browse files Browse the repository at this point in the history
  • Loading branch information
carusogabriel committed Mar 14, 2018
2 parents 86e4a27 + 7176dd4 commit e622a10
Show file tree
Hide file tree
Showing 15 changed files with 50 additions and 44 deletions.
4 changes: 2 additions & 2 deletions lib/Doctrine/ODM/MongoDB/Aggregation/Expr.php
Original file line number Diff line number Diff line change
Expand Up @@ -1627,7 +1627,7 @@ private function operator($operator, $expression)
*
* @param string $method
*
* @throws \LogicException if a current field has not been set
* @throws \LogicException If a current field has not been set.
*/
private function requiresCurrentField($method = null)
{
Expand All @@ -1639,7 +1639,7 @@ private function requiresCurrentField($method = null)
/**
* @param string $method
*
* @throws \BadMethodCallException if there is no current switch operator
* @throws \BadMethodCallException If there is no current switch operator.
*/
private function requiresSwitchStatement($method = null)
{
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ODM/MongoDB/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ public function getFilterParameters($name)
* @param string $className
*
*
* @throws MongoDBException If not is a ObjectRepository
* @throws MongoDBException If not is a ObjectRepository.
*/
public function setDefaultRepositoryClassName($className)
{
Expand Down
16 changes: 8 additions & 8 deletions lib/Doctrine/ODM/MongoDB/DocumentManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ public function getDocumentDatabases()
* Returns the MongoCollection instance for a class.
*
* @param string $className The class name.
* @throws MongoDBException When the $className param is not mapped to a collection
* @throws MongoDBException When the $className param is not mapped to a collection.
* @return Collection
*/
public function getDocumentCollection($className)
Expand Down Expand Up @@ -385,7 +385,7 @@ public function createAggregationBuilder($documentName)
* this DocumentManager as NEW. Do not pass detached documents to the persist operation.
*
* @param object $document The instance to make managed and persistent.
* @throws \InvalidArgumentException When the given $document param is not an object
* @throws \InvalidArgumentException When the given $document param is not an object.
*/
public function persist($document)
{
Expand All @@ -403,7 +403,7 @@ public function persist($document)
* or as a result of the flush operation.
*
* @param object $document The document instance to remove.
* @throws \InvalidArgumentException when the $document param is not an object
* @throws \InvalidArgumentException When the $document param is not an object.
*/
public function remove($document)
{
Expand All @@ -419,7 +419,7 @@ public function remove($document)
* overriding any local changes that have not yet been persisted.
*
* @param object $document The document to refresh.
* @throws \InvalidArgumentException When the given $document param is not an object
* @throws \InvalidArgumentException When the given $document param is not an object.
*/
public function refresh($document)
{
Expand All @@ -438,7 +438,7 @@ public function refresh($document)
* reference it.
*
* @param object $document The document to detach.
* @throws \InvalidArgumentException when the $document param is not an object
* @throws \InvalidArgumentException When the $document param is not an object.
*/
public function detach($document)
{
Expand All @@ -455,7 +455,7 @@ public function detach($document)
*
* @param object $document The detached document to merge into the persistence context.
* @throws LockException
* @throws \InvalidArgumentException if the $document param is not an object
* @throws \InvalidArgumentException If the $document param is not an object.
* @return object The managed copy of the document.
*/
public function merge($document)
Expand Down Expand Up @@ -487,7 +487,7 @@ public function lock($document, $lockMode, $lockVersion = null)
* Releases a lock on the given document.
*
* @param object $document
* @throws \InvalidArgumentException if the $document param is not an object
* @throws \InvalidArgumentException If the $document param is not an object.
*/
public function unlock($document)
{
Expand Down Expand Up @@ -630,7 +630,7 @@ public function close()
* Determines whether a document instance is managed in this DocumentManager.
*
* @param object $document
* @throws \InvalidArgumentException When the $document param is not an object
* @throws \InvalidArgumentException When the $document param is not an object.
* @return bool TRUE if this DocumentManager currently manages the given document, FALSE otherwise.
*/
public function contains($document)
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ODM/MongoDB/Event/PreUpdateEventArgs.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public function setNewValue($field, $value)
* Asserts the field exists in changeset.
*
* @param string $field
* @throws \InvalidArgumentException if the field has no changeset
* @throws \InvalidArgumentException If the field has no changeset.
*/
private function assertValidField($field)
{
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ODM/MongoDB/Id/UuidGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public function generateV4()
*
* @param string $namespace The UUID to seed with
* @param string $salt The string to salt this new UUID with
* @throws \Exception when the provided namespace is invalid
* @throws \Exception When the provided namespace is invalid
* @return string
*/
public function generateV5($namespace, $salt)
Expand Down
6 changes: 3 additions & 3 deletions lib/Doctrine/ODM/MongoDB/Mapping/ClassMetadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -626,8 +626,8 @@ public function setCustomRepositoryClass($repositoryClassName)
* @param string $event Lifecycle event
* @param object $document Document on which the event occurred
* @param array $arguments Arguments to pass to all callbacks
* @throws \InvalidArgumentException if document class is not this class or
* a Proxy of this class
* @throws \InvalidArgumentException If document class is not this class or
* a Proxy of this class.
*/
public function invokeLifecycleCallbacks($event, $document, ?array $arguments = null)
{
Expand Down Expand Up @@ -1545,7 +1545,7 @@ public function getFieldValue($document, $field)
*
* @return array The field mapping.
*
* @throws MappingException if the $fieldName is not found in the fieldMappings array
* @throws MappingException If the $fieldName is not found in the fieldMappings array.
*/
public function getFieldMapping($fieldName)
{
Expand Down
4 changes: 2 additions & 2 deletions lib/Doctrine/ODM/MongoDB/Persisters/PersistenceBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ public function prepareReferencedDocumentValue(array $referenceMapping, $documen
* @param object $embeddedDocument
* @param bool $includeNestedCollections
* @return array|object
* @throws \UnexpectedValueException if an unsupported associating mapping is found
* @throws \UnexpectedValueException If an unsupported associating mapping is found.
*/
public function prepareEmbeddedDocumentValue(array $embeddedMapping, $embeddedDocument, $includeNestedCollections = false)
{
Expand Down Expand Up @@ -414,7 +414,7 @@ public function prepareEmbeddedDocumentValue(array $embeddedMapping, $embeddedDo
* @param object $document
* @param bool $includeNestedCollections
* @return array|object|null
* @throws \InvalidArgumentException if the mapping is neither embedded nor reference
* @throws \InvalidArgumentException if the mapping is neither embedded nor reference.
*/
public function prepareAssociatedDocumentValue(array $mapping, $document, $includeNestedCollections = false)
{
Expand Down
16 changes: 8 additions & 8 deletions lib/Doctrine/ODM/MongoDB/Query/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ public function bitXor($value)
* @see http://docs.mongodb.org/manual/reference/operator/text/
* @param bool $caseSensitive
* @return $this
* @throws \BadMethodCallException if the query does not already have $text criteria
* @throws \BadMethodCallException If the query does not already have $text criteria.
*
*/
public function caseSensitive($caseSensitive)
Expand Down Expand Up @@ -395,7 +395,7 @@ public function debug($name = null)
* @see http://docs.mongodb.org/manual/reference/operator/text/
* @param bool $diacriticSensitive
* @return $this
* @throws \BadMethodCallException if the query does not already have $text criteria
* @throws \BadMethodCallException If the query does not already have $text criteria.
*
*/
public function diacriticSensitive($diacriticSensitive)
Expand Down Expand Up @@ -533,7 +533,7 @@ public function field($field)
*
* @param string|Javascript $finalize
* @return $this
* @throws \BadMethodCallException if the query is not a mapReduce or group command
* @throws \BadMethodCallException If the query is not a mapReduce or group command.
*/
public function finalize($finalize)
{
Expand Down Expand Up @@ -1033,7 +1033,7 @@ public function mapReduce($map, $reduce, $out = ['inline' => true], array $optio
*
* @param array $options
* @return $this
* @throws \BadMethodCallException if the query is not a mapReduce command
* @throws \BadMethodCallException If the query is not a mapReduce command.
*/
public function mapReduceOptions(array $options)
{
Expand Down Expand Up @@ -1203,7 +1203,7 @@ public function notIn(array $values)
*
* @param array|string $out
* @return $this
* @throws \BadMethodCallException if the query is not a mapReduce command
* @throws \BadMethodCallException If the query is not a mapReduce command.
*/
public function out($out)
{
Expand Down Expand Up @@ -1257,7 +1257,7 @@ public function popLast()
*
* @param bool|callable $primer
* @return $this
* @throws \InvalidArgumentException If $primer is not boolean or callable
* @throws \InvalidArgumentException If $primer is not boolean or callable.
*/
public function prime($primer = true)
{
Expand Down Expand Up @@ -1366,7 +1366,7 @@ public function readOnly($bool = true)
*
* @param string|Javascript $reduce
* @return $this
* @throws \BadMethodCallException if the query is not a mapReduce or group command
* @throws \BadMethodCallException If the query is not a mapReduce or group command.
*/
public function reduce($reduce)
{
Expand Down Expand Up @@ -1799,7 +1799,7 @@ public function where($javascript)
*
* @param \Traversable $classNames
* @return array an array of discriminatorValues (mixed type)
* @throws \InvalidArgumentException if the number of found collections > 1
* @throws \InvalidArgumentException If the number of found collections > 1.
*/
private function getDiscriminatorValues($classNames)
{
Expand Down
12 changes: 6 additions & 6 deletions lib/Doctrine/ODM/MongoDB/Query/Expr.php
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ public function bitXor($value)
* @see http://docs.mongodb.org/manual/reference/operator/text/
* @param bool $caseSensitive
* @return $this
* @throws \BadMethodCallException if the query does not already have $text criteria
* @throws \BadMethodCallException If the query does not already have $text criteria.
*
*/
public function caseSensitive($caseSensitive)
Expand Down Expand Up @@ -355,7 +355,7 @@ public function comment($comment)
* @see http://docs.mongodb.org/manual/reference/operator/update/currentDate/
* @param string $type
* @return $this
* @throws \InvalidArgumentException if an invalid type is given
* @throws \InvalidArgumentException If an invalid type is given.
*/
public function currentDate($type = 'date')
{
Expand All @@ -378,7 +378,7 @@ public function currentDate($type = 'date')
* @see http://docs.mongodb.org/manual/reference/operator/text/
* @param bool $diacriticSensitive
* @return $this
* @throws \BadMethodCallException if the query does not already have $text criteria
* @throws \BadMethodCallException If the query does not already have $text criteria.
*
*/
public function diacriticSensitive($diacriticSensitive)
Expand Down Expand Up @@ -587,7 +587,7 @@ public function geoWithinCenterSphere($x, $y, $radius)
* @param array $point3 Third point of the polygon
* @param array ...$points Additional points of the polygon
* @return $this
* @throws \InvalidArgumentException if less than three points are given
* @throws \InvalidArgumentException If less than three points are given.
*/
public function geoWithinPolygon($point1, $point2, $point3, ...$points)
{
Expand Down Expand Up @@ -743,7 +743,7 @@ public function includesReferenceTo($document)
* @see http://docs.mongodb.org/manual/reference/operator/text/
* @param string $language
* @return $this
* @throws \BadMethodCallException if the query does not already have $text criteria
* @throws \BadMethodCallException If the query does not already have $text criteria.
*/
public function language($language)
{
Expand Down Expand Up @@ -1427,7 +1427,7 @@ private function normalizeSortOrder($order): int
/**
* Ensure that a current field has been set.
*
* @throws \LogicException if a current field has not been set
* @throws \LogicException If a current field has not been set.
*/
private function requiresCurrentField()
{
Expand Down
4 changes: 2 additions & 2 deletions lib/Doctrine/ODM/MongoDB/Query/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,8 @@ public function getDocumentManager()
*
* @see http://php.net/manual/en/iteratoraggregate.getiterator.php
* @return Iterator
* @throws \BadMethodCallException if the query type would not return an Iterator
* @throws \UnexpectedValueException if the query did not return an Iterator
* @throws \BadMethodCallException If the query type would not return an Iterator.
* @throws \UnexpectedValueException If the query did not return an Iterator.
*/
public function getIterator()
{
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ODM/MongoDB/Query/ReferencePrimer.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public function __construct(DocumentManager $dm, UnitOfWork $uow)
* @param callable $primer Optional primer callable
* @throws \InvalidArgumentException If the mapped field is not the owning
* side of a reference relationship.
* @throws \InvalidArgumentException If $primer is not callable
* @throws \InvalidArgumentException If $primer is not callable.
* @throws \LogicException If the mapped field is a simple reference and is
* missing a target document class.
*/
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ODM/MongoDB/Types/DateType.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class DateType extends Type
* Converts a value to a DateTime.
* Supports microseconds
*
* @throws InvalidArgumentException if $value is invalid
* @throws InvalidArgumentException If $value is invalid.
* @param mixed $value \DateTimeInterface|\MongoDB\BSON\UTCDateTime|int|float
* @return \DateTime
*/
Expand Down
6 changes: 3 additions & 3 deletions lib/Doctrine/ODM/MongoDB/UnitOfWork.php
Original file line number Diff line number Diff line change
Expand Up @@ -1477,7 +1477,7 @@ public function removeFromIdentityMap($document)
* @param mixed $id Document identifier
* @param ClassMetadata $class Document class
* @return object
* @throws InvalidArgumentException if the class does not have an identifier
* @throws InvalidArgumentException If the class does not have an identifier.
*/
public function getById($id, ClassMetadata $class)
{
Expand All @@ -1499,7 +1499,7 @@ public function getById($id, ClassMetadata $class)
* @param mixed $id Document identifier
* @param ClassMetadata $class Document class
* @return mixed The found document or FALSE.
* @throws InvalidArgumentException if the class does not have an identifier
* @throws InvalidArgumentException If the class does not have an identifier.
*/
public function tryGetById($id, ClassMetadata $class)
{
Expand Down Expand Up @@ -2502,7 +2502,7 @@ private function scheduleCollectionOwner(PersistentCollectionInterface $coll)
* we find a top-level document.
*
* @param object $document
* @throws \UnexpectedValueException when a top-level document could not be found
* @throws \UnexpectedValueException When a top-level document could not be found.
* @return object
*/
public function getOwningDocument($document)
Expand Down
12 changes: 9 additions & 3 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@

<exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedFOREACH" />
<exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedIF" />
<exclude name="Generic.NamingConventions.UpperCaseConstantName.ConstantNotUpperCase" />
<exclude name="PSR1.Classes.ClassDeclaration.MissingNamespace" />
<exclude name="PSR1.Methods.CamelCapsMethodName.NotCamelCaps" />
<exclude name="PSR2.ControlStructures.SwitchDeclaration.WrongOpenercase" />
<exclude name="SlevomatCodingStandard.ControlStructures.EarlyExit" />
Expand All @@ -51,7 +49,6 @@
<exclude name="SlevomatCodingStandard.Classes.UnusedPrivateElements.WriteOnlyProperty" />
<exclude name="SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingPropertyTypeHint" />
<exclude name="Squiz.Classes.ValidClassName.NotCamelCaps" />
<exclude name="Squiz.Commenting.FunctionComment.ThrowsNotCapital" />
<exclude name="Squiz.Commenting.FunctionComment.ThrowsNoFullStop" />
<exclude name="Squiz.Classes.ClassFileName.NoMatch" />
<exclude name="Squiz.Strings.DoubleQuoteUsage.ContainsVar" />
Expand All @@ -64,6 +61,15 @@
</properties>
</rule>

<rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace">
<exclude-pattern>tests/NativePhpunitTask.php</exclude-pattern>
<exclude-pattern>tests/Doctrine/ODM/MongoDB/Tests/Mapping/Documents/GlobalNamespaceDocument.php</exclude-pattern>
</rule>

<rule ref="Generic.NamingConventions.UpperCaseConstantName.ConstantNotUpperCase">
<exclude-pattern>tests/NativePhpunitTask.php</exclude-pattern>
</rule>

<rule ref="Generic.NamingConventions.UpperCaseConstantName.ClassConstantNotUpperCase">
<exclude-pattern>lib/Doctrine/ODM/MongoDB/Events.php</exclude-pattern>
</rule>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function __construct()
*
* @param string $name
* @param mixed $value
* @throws \ReflectionException if the property does not exist
* @throws \ReflectionException If the property does not exist.
*/
public function __set($name, $value)
{
Expand All @@ -35,7 +35,7 @@ public function __set($name, $value)
*
* @param string $name
* @return mixed
* @throws \ReflectionException if the property does not exist
* @throws \ReflectionException If the property does not exist.
*/
public function __get($name)
{
Expand Down

0 comments on commit e622a10

Please sign in to comment.