Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #652 from doctrine/styleci

added .styleci.yml
  • Loading branch information...
commit 718955afb25fc193d26c54074b52d2660112f119 2 parents 7a4131e + 23c1300
@dbu dbu authored
Showing with 223 additions and 316 deletions.
  1. +8 −0 .styleci.yml
  2. +1 −0  bin/phpcrodm.php
  3. +2 −2 lib/Doctrine/ODM/PHPCR/Configuration.php
  4. +5 −5 lib/Doctrine/ODM/PHPCR/Document/File.php
  5. +0 −1  lib/Doctrine/ODM/PHPCR/Document/Resource.php
  6. +0 −1  lib/Doctrine/ODM/PHPCR/DocumentClassMapper.php
  7. +0 −1  lib/Doctrine/ODM/PHPCR/DocumentClassMapperInterface.php
  8. +0 −3  lib/Doctrine/ODM/PHPCR/DocumentManager.php
  9. +0 −1  lib/Doctrine/ODM/PHPCR/DocumentManagerInterface.php
  10. +0 −2  lib/Doctrine/ODM/PHPCR/DocumentRepository.php
  11. +1 −1  lib/Doctrine/ODM/PHPCR/Exception/RuntimeException.php
  12. +1 −1  lib/Doctrine/ODM/PHPCR/Id/AutoIdGenerator.php
  13. +0 −1  lib/Doctrine/ODM/PHPCR/ImmutableReferrersCollection.php
  14. +3 −1 lib/Doctrine/ODM/PHPCR/Mapping/Annotations/PostLoad.php
  15. +3 −1 lib/Doctrine/ODM/PHPCR/Mapping/Annotations/PostPersist.php
  16. +3 −1 lib/Doctrine/ODM/PHPCR/Mapping/Annotations/PostRemove.php
  17. +3 −1 lib/Doctrine/ODM/PHPCR/Mapping/Annotations/PostUpdate.php
  18. +3 −1 lib/Doctrine/ODM/PHPCR/Mapping/Annotations/PrePersist.php
  19. +3 −1 lib/Doctrine/ODM/PHPCR/Mapping/Annotations/PreRemove.php
  20. +3 −1 lib/Doctrine/ODM/PHPCR/Mapping/Annotations/PreUpdate.php
  21. +0 −1  lib/Doctrine/ODM/PHPCR/Mapping/Annotations/Property.php
  22. +0 −1  lib/Doctrine/ODM/PHPCR/Mapping/Annotations/Reference.php
  23. +1 −0  lib/Doctrine/ODM/PHPCR/Mapping/Annotations/TranslatableProperty.php
  24. +5 −5 lib/Doctrine/ODM/PHPCR/Mapping/ClassMetadata.php
  25. +9 −9 lib/Doctrine/ODM/PHPCR/Mapping/Driver/AnnotationDriver.php
  26. +0 −1  lib/Doctrine/ODM/PHPCR/Mapping/Driver/XmlDriver.php
  27. +1 −1  lib/Doctrine/ODM/PHPCR/PHPCRExceptionInterface.php
  28. +1 −1  lib/Doctrine/ODM/PHPCR/Proxy/ProxyFactory.php
  29. +2 −3 lib/Doctrine/ODM/PHPCR/Query/Builder/ConstraintChild.php
  30. +0 −1  lib/Doctrine/ODM/PHPCR/Query/Builder/ConstraintFieldIsset.php
  31. +1 −1  lib/Doctrine/ODM/PHPCR/Query/Builder/ConstraintFullTextSearch.php
  32. +0 −1  lib/Doctrine/ODM/PHPCR/Query/Builder/ConstraintNot.php
  33. +0 −1  lib/Doctrine/ODM/PHPCR/Query/Builder/ConstraintOrx.php
  34. +1 −2  lib/Doctrine/ODM/PHPCR/Query/Builder/ConverterPhpcr.php
  35. +2 −2 lib/Doctrine/ODM/PHPCR/Query/Builder/Field.php
  36. +0 −1  lib/Doctrine/ODM/PHPCR/Query/Builder/From.php
  37. +0 −1  lib/Doctrine/ODM/PHPCR/Query/Builder/OperandDynamicFactory.php
  38. +2 −2 lib/Doctrine/ODM/PHPCR/Query/Builder/OperandDynamicField.php
  39. +1 −1  lib/Doctrine/ODM/PHPCR/Query/Builder/OperandDynamicFullTextSearchScore.php
  40. +3 −3 lib/Doctrine/ODM/PHPCR/Query/Builder/OperandDynamicLength.php
  41. +1 −1  lib/Doctrine/ODM/PHPCR/Query/Builder/OperandDynamicLocalName.php
  42. +1 −1  lib/Doctrine/ODM/PHPCR/Query/Builder/OperandDynamicName.php
  43. +0 −1  lib/Doctrine/ODM/PHPCR/Query/Builder/OperandFactory.php
  44. +0 −1  lib/Doctrine/ODM/PHPCR/Query/Builder/OperandStaticFactory.php
  45. +1 −1  lib/Doctrine/ODM/PHPCR/Query/Builder/OperandStaticLiteral.php
  46. +1 −1  lib/Doctrine/ODM/PHPCR/Query/Builder/OperandStaticParameter.php
  47. +0 −1  lib/Doctrine/ODM/PHPCR/Query/Builder/OrderByAdd.php
  48. +0 −1  lib/Doctrine/ODM/PHPCR/Query/Builder/QueryBuilder.php
  49. +0 −1  lib/Doctrine/ODM/PHPCR/Query/Builder/Select.php
  50. +0 −1  lib/Doctrine/ODM/PHPCR/Query/Builder/SelectAdd.php
  51. +2 −2 lib/Doctrine/ODM/PHPCR/Query/Builder/SourceJoinConditionChildDocument.php
  52. +0 −1  lib/Doctrine/ODM/PHPCR/Query/Builder/SourceJoinConditionEqui.php
  53. +3 −5 lib/Doctrine/ODM/PHPCR/Query/Builder/SourceJoinConditionSameDocument.php
  54. +0 −1  lib/Doctrine/ODM/PHPCR/Query/Builder/SourceJoinLeft.php
  55. +0 −1  lib/Doctrine/ODM/PHPCR/Query/Builder/SourceJoinRight.php
  56. +0 −1  lib/Doctrine/ODM/PHPCR/Query/Expression/SameNode.php
  57. +1 −1  lib/Doctrine/ODM/PHPCR/Repository/DefaultRepositoryFactory.php
  58. +1 −1  lib/Doctrine/ODM/PHPCR/Repository/RepositoryFactory.php
  59. +0 −2  lib/Doctrine/ODM/PHPCR/Tools/Console/Command/DocumentMigrateClassCommand.php
  60. +2 −1  lib/Doctrine/ODM/PHPCR/Tools/Console/Command/DumpQueryBuilderReferenceCommand.php
  61. +4 −6 lib/Doctrine/ODM/PHPCR/Tools/Console/Command/GenerateProxiesCommand.php
  62. +0 −2  lib/Doctrine/ODM/PHPCR/Tools/Console/Command/RegisterSystemNodeTypesCommand.php
  63. +0 −1  lib/Doctrine/ODM/PHPCR/Tools/Console/Helper/DocumentManagerHelper.php
  64. +1 −1  lib/Doctrine/ODM/PHPCR/Tools/Console/MetadataFilter.php
  65. +0 −1  lib/Doctrine/ODM/PHPCR/Tools/Helper/PrefetchHelper.php
  66. +1 −1  lib/Doctrine/ODM/PHPCR/Tools/Test/QueryBuilderTester.php
  67. +0 −1  lib/Doctrine/ODM/PHPCR/Translation/LocaleChooser/LocaleChooser.php
  68. +2 −3 lib/Doctrine/ODM/PHPCR/Translation/TranslationStrategy/AttributeTranslationStrategy.php
  69. +1 −2  lib/Doctrine/ODM/PHPCR/Translation/TranslationStrategy/TranslationNodesWarmer.php
  70. +0 −1  lib/Doctrine/ODM/PHPCR/Translation/TranslationStrategy/TranslationStrategyInterface.php
  71. +4 −8 lib/Doctrine/ODM/PHPCR/UnitOfWork.php
  72. +0 −1  tests/Doctrine/Tests/Models/Blog/Comment.php
  73. +0 −1  tests/Doctrine/Tests/Models/Blog/User.php
  74. +3 −5 tests/Doctrine/Tests/Models/CMS/CmsArticle.php
  75. +0 −1  tests/Doctrine/Tests/Models/CMS/CmsArticlePerson.php
  76. +0 −1  tests/Doctrine/Tests/Models/CMS/CmsGroup.php
  77. +2 −2 tests/Doctrine/Tests/Models/CMS/CmsPage.php
  78. +1 −1  tests/Doctrine/Tests/Models/References/RefCascadeManyTestObj.php
  79. +1 −1  tests/Doctrine/Tests/Models/References/RefManyTestObj.php
  80. +3 −2 tests/Doctrine/Tests/Models/Translation/DerivedArticle.php
  81. +1 −2  tests/Doctrine/Tests/Models/Versioning/FullVersionableArticleWithChildren.php
  82. +1 −1  tests/Doctrine/Tests/ODM/PHPCR/ConfigurationTest.php
  83. +6 −2 tests/Doctrine/Tests/ODM/PHPCR/DocumentClassMapperTest.php
  84. +0 −1  tests/Doctrine/Tests/ODM/PHPCR/Event/MoveEventArgsTest.php
  85. +0 −1  tests/Doctrine/Tests/ODM/PHPCR/Functional/BasicCrudTest.php
  86. +1 −1  tests/Doctrine/Tests/ODM/PHPCR/Functional/CascadeRefreshTest.php
  87. +2 −2 tests/Doctrine/Tests/ODM/PHPCR/Functional/CascadeRemoveTest.php
  88. +0 −1  tests/Doctrine/Tests/ODM/PHPCR/Functional/ChangesetCalculationTest.php
  89. +0 −1  tests/Doctrine/Tests/ODM/PHPCR/Functional/DocumentManagerTest.php
  90. +7 −10 tests/Doctrine/Tests/ODM/PHPCR/Functional/EventManagerResetTest.php
  91. +13 −15 tests/Doctrine/Tests/ODM/PHPCR/Functional/EventManagerTest.php
  92. +0 −1  tests/Doctrine/Tests/ODM/PHPCR/Functional/FindTypeValidationTest.php
  93. +0 −1  tests/Doctrine/Tests/ODM/PHPCR/Functional/FixPHPCR1Test.php
  94. +0 −1  tests/Doctrine/Tests/ODM/PHPCR/Functional/FlushTest.php
  95. +0 −1  tests/Doctrine/Tests/ODM/PHPCR/Functional/FolderFileTest.php
  96. +13 −13 tests/Doctrine/Tests/ODM/PHPCR/Functional/Hierarchy/ChildTest.php
  97. +13 −15 tests/Doctrine/Tests/ODM/PHPCR/Functional/Hierarchy/ChildrenTest.php
  98. +2 −2 tests/Doctrine/Tests/ODM/PHPCR/Functional/Hierarchy/ParentTest.php
  99. +0 −1  tests/Doctrine/Tests/ODM/PHPCR/Functional/Mapping/AnnotationMappingTest.php
  100. +0 −1  tests/Doctrine/Tests/ODM/PHPCR/Functional/MixinTest.php
  101. +0 −2  tests/Doctrine/Tests/ODM/PHPCR/Functional/MoveByAssignmentTest.php
  102. +0 −2  tests/Doctrine/Tests/ODM/PHPCR/Functional/MoveTest.php
  103. +0 −1  tests/Doctrine/Tests/ODM/PHPCR/Functional/ProxyTest.php
  104. +2 −2 tests/Doctrine/Tests/ODM/PHPCR/Functional/QueryBuilderJoinTest.php
  105. +1 −1  tests/Doctrine/Tests/ODM/PHPCR/Functional/QuerySql2Test.php
  106. +5 −8 tests/Doctrine/Tests/ODM/PHPCR/Functional/ReferenceTest.php
  107. +0 −1  tests/Doctrine/Tests/ODM/PHPCR/Functional/Translation/AttributeTranslationStrategyTest.php
  108. +4 −5 tests/Doctrine/Tests/ODM/PHPCR/Functional/Translation/ChildTranslationStrategyTest.php
  109. +0 −1  tests/Doctrine/Tests/ODM/PHPCR/Functional/Translation/DocumentManagerTest.php
  110. +3 −4 tests/Doctrine/Tests/ODM/PHPCR/Functional/Translation/TranslationHierarchyTest.php
  111. +3 −4 tests/Doctrine/Tests/ODM/PHPCR/Functional/Translation/TranslationTest.php
  112. +11 −11 tests/Doctrine/Tests/ODM/PHPCR/Functional/UnitOfWorkTest.php
  113. +2 −3 tests/Doctrine/Tests/ODM/PHPCR/Functional/Versioning/AnnotationsTest.php
  114. +1 −0  tests/Doctrine/Tests/ODM/PHPCR/Functional/Versioning/SimpleVersioningTest.php
  115. +1 −2  tests/Doctrine/Tests/ODM/PHPCR/Functional/Versioning/VersioningTestAbstract.php
  116. +0 −1  tests/Doctrine/Tests/ODM/PHPCR/Id/AssignedIdGeneratorTest.php
  117. +0 −1  tests/Doctrine/Tests/ODM/PHPCR/Id/IdGeneratorTest.php
  118. +4 −2 tests/Doctrine/Tests/ODM/PHPCR/Id/ParentIdGeneratorTest.php
  119. +0 −2  tests/Doctrine/Tests/ODM/PHPCR/Id/RepositoryIdGeneratorTest.php
  120. +6 −5 tests/Doctrine/Tests/ODM/PHPCR/Mapping/ClassMetadataTest.php
  121. +0 −1  tests/Doctrine/Tests/ODM/PHPCR/Mapping/Model/ClassInheritanceChildMappingObject.php
  122. +0 −1  tests/Doctrine/Tests/ODM/PHPCR/Mapping/Model/ClassInheritanceChildOverridesMappingObject.php
  123. +0 −1  tests/Doctrine/Tests/ODM/PHPCR/Mapping/Model/ClassInheritanceParentMappingObject.php
  124. +0 −2  tests/Doctrine/Tests/ODM/PHPCR/Mapping/Model/DefaultMappingObject.php
  125. +0 −1  tests/Doctrine/Tests/ODM/PHPCR/Mapping/Model/InheritedMixinMappingObject.php
  126. +0 −7 tests/Doctrine/Tests/ODM/PHPCR/Mapping/Model/LifecycleCallbackMappingObject.php
  127. +0 −1  tests/Doctrine/Tests/ODM/PHPCR/Mapping/Model/MixinMappingObject.php
  128. +0 −1  tests/Doctrine/Tests/ODM/PHPCR/Mapping/Model/ReferenceableChildMappingObject.php
  129. +0 −1  tests/Doctrine/Tests/ODM/PHPCR/Mapping/Model/ReferenceableChildReferenceableFalseMappingObject.php
  130. +0 −1  tests/Doctrine/Tests/ODM/PHPCR/Mapping/Model/ReplaceMixinMappingObject.php
  131. +1 −1  tests/Doctrine/Tests/ODM/PHPCR/Mapping/XmlDriverTest.php
  132. +1 −1  tests/Doctrine/Tests/ODM/PHPCR/Mapping/YamlDriverTest.php
  133. +2 −2 tests/Doctrine/Tests/ODM/PHPCR/PHPCRFunctionalTestCase.php
  134. +1 −2  tests/Doctrine/Tests/ODM/PHPCR/PHPCRTestCase.php
  135. +9 −9 tests/Doctrine/Tests/ODM/PHPCR/Query/Builder/AbstractNodeTest.php
  136. +0 −2  tests/Doctrine/Tests/ODM/PHPCR/Query/Builder/ConstraintFactoryTest.php
  137. +1 −1  tests/Doctrine/Tests/ODM/PHPCR/Query/Builder/ConverterPhpcrTest.php
  138. +0 −1  tests/Doctrine/Tests/ODM/PHPCR/Query/Builder/FieldTest.php
  139. +0 −2  tests/Doctrine/Tests/ODM/PHPCR/Query/Builder/FromTest.php
  140. +0 −1  tests/Doctrine/Tests/ODM/PHPCR/Query/Builder/LeafNodeTestCase.php
  141. +0 −2  tests/Doctrine/Tests/ODM/PHPCR/Query/Builder/OperandDynamicFactoryTest.php
  142. +0 −2  tests/Doctrine/Tests/ODM/PHPCR/Query/Builder/OperandStaticFactoryTest.php
  143. +0 −3  tests/Doctrine/Tests/ODM/PHPCR/Query/Builder/OrderByTest.php
  144. +0 −2  tests/Doctrine/Tests/ODM/PHPCR/Query/Builder/SelectTest.php
  145. +1 −1  tests/Doctrine/Tests/ODM/PHPCR/Tools/Command/DumpQueryBuilderReferenceCommandTest.php
  146. +0 −1  tests/Doctrine/Tests/ODM/PHPCR/Translation/AttributeTranslationStrategyTest.php
  147. +0 −2  tests/Doctrine/Tests/ODM/PHPCR/Translation/LocaleChooserTest.php
  148. +0 −1  tests/Doctrine/Tests/ODM/PHPCR/UnitOfWorkTest.php
  149. +1 −0  tests/bootstrap.php
View
8 .styleci.yml
@@ -0,0 +1,8 @@
+preset: psr2
+
+enabled:
+ - long_array_syntax
+ - duplicate_semicolon
+
+disabled:
+ - short_array_syntax
View
1  bin/phpcrodm.php
@@ -20,6 +20,7 @@
}
use Doctrine\Common\Annotations\AnnotationRegistry;
+
AnnotationRegistry::registerLoader(array($autoload, 'loadClass'));
$configFile = getcwd() . DIRECTORY_SEPARATOR . 'cli-config.php';
View
4 lib/Doctrine/ODM/PHPCR/Configuration.php
@@ -287,7 +287,7 @@ public function setClassMetadataFactoryName($cmfName)
*/
public function getClassMetadataFactoryName()
{
- if ( ! isset($this->attributes['classMetadataFactoryName'])) {
+ if (! isset($this->attributes['classMetadataFactoryName'])) {
$this->attributes['classMetadataFactoryName'] = 'Doctrine\ODM\PHPCR\Mapping\ClassMetadataFactory';
}
@@ -309,7 +309,7 @@ public function setDefaultRepositoryClassName($className)
{
$reflectionClass = new \ReflectionClass($className);
- if ( ! $reflectionClass->implementsInterface('Doctrine\Common\Persistence\ObjectRepository')) {
+ if (! $reflectionClass->implementsInterface('Doctrine\Common\Persistence\ObjectRepository')) {
throw PHPCRException::invalidDocumentRepository($className);
}
View
10 lib/Doctrine/ODM/PHPCR/Document/File.php
@@ -64,8 +64,8 @@ public function setFileContentFromFilesystem($filename)
$this->content->setLastModified(new \DateTime('@'.filemtime($filename)));
$finfo = new \finfo();
- $this->content->setMimeType($finfo->file($filename,FILEINFO_MIME_TYPE));
- $this->content->setEncoding($finfo->file($filename,FILEINFO_MIME_ENCODING));
+ $this->content->setMimeType($finfo->file($filename, FILEINFO_MIME_TYPE));
+ $this->content->setEncoding($finfo->file($filename, FILEINFO_MIME_ENCODING));
return $this;
}
@@ -132,7 +132,7 @@ public function setFileContent($content)
*/
public function getFileContentAsStream()
{
- return $this->getContent()->getData();
+ return $this->getContent()->getData();
}
/**
@@ -142,8 +142,8 @@ public function getFileContentAsStream()
*/
public function getFileContent()
{
- $content = stream_get_contents($this->getContent()->getData());
+ $content = stream_get_contents($this->getContent()->getData());
- return $content !== false ? $content : '';
+ return $content !== false ? $content : '';
}
}
View
1  lib/Doctrine/ODM/PHPCR/Document/Resource.php
@@ -21,7 +21,6 @@
use Doctrine\ODM\PHPCR\Exception\BadMethodCallException;
use PHPCR\NodeInterface;
-
use Doctrine\ODM\PHPCR\Mapping\Annotations as PHPCRODM;
/**
View
1  lib/Doctrine/ODM/PHPCR/DocumentClassMapper.php
@@ -20,7 +20,6 @@
namespace Doctrine\ODM\PHPCR;
use Doctrine\ODM\PHPCR\Exception\ClassMismatchException;
-
use PHPCR\NodeInterface;
use PHPCR\PropertyType;
View
1  lib/Doctrine/ODM/PHPCR/DocumentClassMapperInterface.php
@@ -20,7 +20,6 @@
namespace Doctrine\ODM\PHPCR;
use Doctrine\ODM\PHPCR\Exception\ClassMismatchException;
-
use PHPCR\NodeInterface;
interface DocumentClassMapperInterface
View
3  lib/Doctrine/ODM/PHPCR/DocumentManager.php
@@ -31,11 +31,9 @@
use Doctrine\ODM\PHPCR\Query\Query;
use Doctrine\ODM\PHPCR\Query\Builder\QueryBuilder;
use Doctrine\ODM\PHPCR\Query\Builder\ConverterPhpcr;
-
use Doctrine\Common\EventManager;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\Common\Collections\ArrayCollection;
-
use PHPCR\SessionInterface;
use PHPCR\Query\QueryInterface;
use PHPCR\UnsupportedRepositoryOperationException;
@@ -302,7 +300,6 @@ public function find($className, $id)
} catch (ClassMismatchException $e) {
return null;
}
-
}
$node = $this->session->getNode($id);
} catch (PathNotFoundException $e) {
View
1  lib/Doctrine/ODM/PHPCR/DocumentManagerInterface.php
@@ -28,7 +28,6 @@
use Doctrine\ODM\PHPCR\Translation\TranslationStrategy\TranslationStrategyInterface;
use Doctrine\ODM\PHPCR\Translation\LocaleChooser\LocaleChooserInterface;
use Doctrine\ODM\PHPCR\Query\Query;
-
use PHPCR\Query\QueryInterface;
use PHPCR\PropertyType;
use Doctrine\ODM\PHPCR\Query\Builder\QueryBuilder;
View
2  lib/Doctrine/ODM/PHPCR/DocumentRepository.php
@@ -22,10 +22,8 @@
use Doctrine\Common\Persistence\ObjectRepository;
use Doctrine\ODM\PHPCR\Mapping\ClassMetadata;
use Doctrine\ODM\PHPCR\Query\Query;
-
use PHPCR\Query\QOM\QueryObjectModelConstantsInterface as Constants;
use Doctrine\ODM\PHPCR\Exception\InvalidArgumentException;
-
use Doctrine\ODM\PHPCR\Query\Builder\ConstraintFactory;
/**
View
2  lib/Doctrine/ODM/PHPCR/Exception/RuntimeException.php
@@ -26,7 +26,7 @@
*/
class RuntimeException extends \RuntimeException implements PHPCRExceptionInterface
{
- static public function invalidUuid($id, $class, $uuid)
+ public static function invalidUuid($id, $class, $uuid)
{
return new self(sprintf(
'Document %s of class %s has an invalid UUID "%s"',
View
2  lib/Doctrine/ODM/PHPCR/Id/AutoIdGenerator.php
@@ -63,6 +63,6 @@ public function generate($document, ClassMetadata $class, DocumentManagerInterfa
''
);
- return $this->buildName($document ,$class, $dm, $parent, $name);
+ return $this->buildName($document, $class, $dm, $parent, $name);
}
}
View
1  lib/Doctrine/ODM/PHPCR/ImmutableReferrersCollection.php
@@ -19,7 +19,6 @@
namespace Doctrine\ODM\PHPCR;
-
/**
* Immutable referrer collection class
*
View
4 lib/Doctrine/ODM/PHPCR/Mapping/Annotations/PostLoad.php
@@ -25,4 +25,6 @@
* @Annotation
* @Target("METHOD")
*/
-final class PostLoad {}
+final class PostLoad
+{
+}
View
4 lib/Doctrine/ODM/PHPCR/Mapping/Annotations/PostPersist.php
@@ -25,4 +25,6 @@
* @Annotation
* @Target("METHOD")
*/
-final class PostPersist {}
+final class PostPersist
+{
+}
View
4 lib/Doctrine/ODM/PHPCR/Mapping/Annotations/PostRemove.php
@@ -25,4 +25,6 @@
* @Annotation
* @Target("METHOD")
*/
-final class PostRemove {}
+final class PostRemove
+{
+}
View
4 lib/Doctrine/ODM/PHPCR/Mapping/Annotations/PostUpdate.php
@@ -25,4 +25,6 @@
* @Annotation
* @Target("METHOD")
*/
-final class PostUpdate {}
+final class PostUpdate
+{
+}
View
4 lib/Doctrine/ODM/PHPCR/Mapping/Annotations/PrePersist.php
@@ -25,4 +25,6 @@
* @Annotation
* @Target("METHOD")
*/
-final class PrePersist {}
+final class PrePersist
+{
+}
View
4 lib/Doctrine/ODM/PHPCR/Mapping/Annotations/PreRemove.php
@@ -25,4 +25,6 @@
* @Annotation
* @Target("METHOD")
*/
-final class PreRemove {}
+final class PreRemove
+{
+}
View
4 lib/Doctrine/ODM/PHPCR/Mapping/Annotations/PreUpdate.php
@@ -25,4 +25,6 @@
* @Annotation
* @Target("METHOD")
*/
-final class PreUpdate {}
+final class PreUpdate
+{
+}
View
1  lib/Doctrine/ODM/PHPCR/Mapping/Annotations/Property.php
@@ -19,7 +19,6 @@
namespace Doctrine\ODM\PHPCR\Mapping\Annotations;
-
/**
* base class for all property types
*/
View
1  lib/Doctrine/ODM/PHPCR/Mapping/Annotations/Reference.php
@@ -19,7 +19,6 @@
namespace Doctrine\ODM\PHPCR\Mapping\Annotations;
-
/**
* base class for the reference types
*/
View
1  lib/Doctrine/ODM/PHPCR/Mapping/Annotations/TranslatableProperty.php
@@ -18,6 +18,7 @@
*/
namespace Doctrine\ODM\PHPCR\Mapping\Annotations;
+
/**
* Base class for all the translatable properties (i.e. every property but Uuid and Version)
*/
View
10 lib/Doctrine/ODM/PHPCR/Mapping/ClassMetadata.php
@@ -470,7 +470,7 @@ public function validateReferences()
{
foreach ($this->referenceMappings as $fieldName) {
$mapping = $this->mappings[$fieldName];
- if (!empty($mapping['targetDocument']) && !ClassLoader::classExists($mapping['targetDocument']) ) {
+ if (!empty($mapping['targetDocument']) && !ClassLoader::classExists($mapping['targetDocument'])) {
throw MappingException::invalidTargetDocumentClass($mapping['targetDocument'], $this->name, $mapping['fieldName']);
}
}
@@ -980,11 +980,11 @@ public function validateClassMapping()
$assocFields[$mapping['assoc']] = $fieldName;
}
- if (!empty($this->versionNameField) && !$this->versionable){
+ if (!empty($this->versionNameField) && !$this->versionable) {
throw new MappingException(sprintf("You cannot use the @VersionName annotation on the non-versionable document %s (field = %s)", $this->name, $this->versionNameField));
}
- if (!empty($this->versionCreatedField) && !$this->versionable){
+ if (!empty($this->versionCreatedField) && !$this->versionable) {
throw new MappingException(sprintf("You cannot use the @VersionCreated annotation on the non-versionable document %s (field = %s)", $this->name, $this->versionCreatedField));
}
@@ -1022,7 +1022,7 @@ public function validateClassMapping()
*
* @throws MappingException if no strategy is applicable with the mapped fields.
*/
- private function determineIdStrategy()
+ private function determineIdStrategy()
{
if ($this->parentMapping && $this->nodename) {
$this->setIdGenerator(self::GENERATOR_TYPE_PARENT);
@@ -1679,7 +1679,7 @@ public function getUuidFieldName()
*/
public function isUuid($fieldName)
{
- return $this->uuidFieldName === $fieldName;
+ return $this->uuidFieldName === $fieldName;
}
/**
View
18 lib/Doctrine/ODM/PHPCR/Mapping/Driver/AnnotationDriver.php
@@ -19,14 +19,14 @@
namespace Doctrine\ODM\PHPCR\Mapping\Driver;
-use Doctrine\Common\Annotations\AnnotationReader,
- Doctrine\Common\Annotations\Reader,
- Doctrine\Common\Persistence\Mapping\Driver\AnnotationDriver as AbstractAnnotationDriver,
- Doctrine\Common\Persistence\Mapping\ClassMetadata,
- Doctrine\Common\Persistence\Mapping\Driver\MappingDriver,
- Doctrine\ODM\PHPCR\Event,
- Doctrine\ODM\PHPCR\Mapping\Annotations as ODM,
- Doctrine\ODM\PHPCR\Mapping\MappingException;
+use Doctrine\Common\Annotations\AnnotationReader;
+use Doctrine\Common\Annotations\Reader;
+use Doctrine\Common\Persistence\Mapping\Driver\AnnotationDriver as AbstractAnnotationDriver;
+use Doctrine\Common\Persistence\Mapping\ClassMetadata;
+use Doctrine\Common\Persistence\Mapping\Driver\MappingDriver;
+use Doctrine\ODM\PHPCR\Event;
+use Doctrine\ODM\PHPCR\Mapping\Annotations as ODM;
+use Doctrine\ODM\PHPCR\Mapping\MappingException;
/**
* The AnnotationDriver reads the mapping metadata from docblock annotations.
@@ -68,7 +68,7 @@ public function loadMetadataForClass($className, ClassMetadata $metadata)
}
}
if (!$documentAnnots) {
- throw MappingException::classIsNotAValidDocument($className);
+ throw MappingException::classIsNotAValidDocument($className);
}
// find the winning document annotation
View
1  lib/Doctrine/ODM/PHPCR/Mapping/Driver/XmlDriver.php
@@ -134,7 +134,6 @@ public function loadMetadataForClass($className, ClassMetadata $class)
}
if (isset($xmlRoot->node)) {
$class->mapNode(array('fieldName' => (string) $xmlRoot->node->attributes()->name));
-
}
if (isset($xmlRoot->nodename)) {
$class->mapNodename(array('fieldName' => (string) $xmlRoot->nodename->attributes()->name));
View
2  lib/Doctrine/ODM/PHPCR/PHPCRExceptionInterface.php
@@ -24,4 +24,4 @@
*/
interface PHPCRExceptionInterface
{
-}
+}
View
2  lib/Doctrine/ODM/PHPCR/Proxy/ProxyFactory.php
@@ -79,7 +79,7 @@ public function __construct(DocumentManagerInterface $documentManager, $proxyDir
*/
protected function skipClass(BaseClassMetadata $metadata)
{
- if ( ! $metadata instanceof ClassMetadata) {
+ if (! $metadata instanceof ClassMetadata) {
throw new InvalidArgumentException('Did not get the expected type of metadata but ' . get_class($metadata));
}
View
5 lib/Doctrine/ODM/PHPCR/Query/Builder/ConstraintChild.php
@@ -2,7 +2,6 @@
namespace Doctrine\ODM\PHPCR\Query\Builder;
-
/**
* Constraint evaluates to true if aliased node is a child of
* the given parent path for the given alias.
@@ -23,12 +22,12 @@ public function getNodeType()
return self::NT_CONSTRAINT;
}
- public function getParentPath()
+ public function getParentPath()
{
return $this->parentPath;
}
- public function getAlias()
+ public function getAlias()
{
return $this->alias;
}
View
1  lib/Doctrine/ODM/PHPCR/Query/Builder/ConstraintFieldIsset.php
@@ -2,7 +2,6 @@
namespace Doctrine\ODM\PHPCR\Query\Builder;
-
/**
* Constraint which evaluates to true if the specified field on
* the aliased document isset, or alternatively speaking, is not-null.
View
2  lib/Doctrine/ODM/PHPCR/Query/Builder/ConstraintFullTextSearch.php
@@ -17,7 +17,7 @@ class ConstraintFullTextSearch extends AbstractLeafNode
protected $field;
protected $fullTextSearchExpression;
- Public function __construct(AbstractNode $parent, $field, $fullTextSearchExpression)
+ public function __construct(AbstractNode $parent, $field, $fullTextSearchExpression)
{
list($alias, $field) = $this->explodeField($field);
$this->alias = $alias;
View
1  lib/Doctrine/ODM/PHPCR/Query/Builder/ConstraintNot.php
@@ -21,5 +21,4 @@ public function getNodeType()
{
return self::NT_CONSTRAINT;
}
-
}
View
1  lib/Doctrine/ODM/PHPCR/Query/Builder/ConstraintOrx.php
@@ -24,5 +24,4 @@ public function getNodeType()
{
return self::NT_CONSTRAINT;
}
-
}
View
3  lib/Doctrine/ODM/PHPCR/Query/Builder/ConverterPhpcr.php
@@ -27,7 +27,6 @@
use Doctrine\ODM\PHPCR\DocumentManagerInterface;
use Doctrine\ODM\PHPCR\Query\Builder\AbstractNode as QBConstants;
use Doctrine\ODM\PHPCR\Exception\InvalidArgumentException;
-
use PHPCR\Query\QOM\QueryObjectModelFactoryInterface;
use PHPCR\Query\QOM\QueryObjectModelConstantsInterface as QOMConstants;
@@ -131,7 +130,7 @@ protected function validateAlias($alias)
protected function getPhpcrProperty($originalAlias, $odmField)
{
$this->validateAlias($originalAlias);
- $meta = $this->aliasMetadata[$originalAlias];;
+ $meta = $this->aliasMetadata[$originalAlias];
if ($meta->hasField($odmField)) {
$fieldMeta = $meta->getFieldMapping($odmField);
View
4 lib/Doctrine/ODM/PHPCR/Query/Builder/Field.php
@@ -15,12 +15,12 @@ public function __construct(AbstractNode $parent, $field)
parent::__construct($parent);
}
- public function getField()
+ public function getField()
{
return $this->field;
}
- public function getAlias()
+ public function getAlias()
{
return $this->alias;
}
View
1  lib/Doctrine/ODM/PHPCR/Query/Builder/From.php
@@ -21,5 +21,4 @@ public function getNodeType()
{
return self::NT_FROM;
}
-
}
View
1  lib/Doctrine/ODM/PHPCR/Query/Builder/OperandDynamicFactory.php
@@ -193,4 +193,3 @@ public function field($field)
return $this->addChild(new OperandDynamicField($this, $field));
}
}
-
View
4 lib/Doctrine/ODM/PHPCR/Query/Builder/OperandDynamicField.php
@@ -26,12 +26,12 @@ public function getNodeType()
return self::NT_OPERAND_DYNAMIC;
}
- public function getAlias()
+ public function getAlias()
{
return $this->alias;
}
- public function getField()
+ public function getField()
{
return $this->field;
}
View
2  lib/Doctrine/ODM/PHPCR/Query/Builder/OperandDynamicFullTextSearchScore.php
@@ -12,7 +12,7 @@ public function __construct(AbstractNode $parent, $alias)
parent::__construct($parent);
}
- public function getAlias()
+ public function getAlias()
{
return $this->alias;
}
View
6 lib/Doctrine/ODM/PHPCR/Query/Builder/OperandDynamicLength.php
@@ -7,7 +7,7 @@ class OperandDynamicLength extends AbstractLeafNode
protected $alias;
protected $field;
- Public function __construct(AbstractNode $parent, $field)
+ public function __construct(AbstractNode $parent, $field)
{
list($alias, $field) = $this->explodeField($field);
$this->field = $field;
@@ -20,12 +20,12 @@ public function getNodeType()
return self::NT_OPERAND_DYNAMIC;
}
- public function getField()
+ public function getField()
{
return $this->field;
}
- public function getAlias()
+ public function getAlias()
{
return $this->alias;
}
View
2  lib/Doctrine/ODM/PHPCR/Query/Builder/OperandDynamicLocalName.php
@@ -12,7 +12,7 @@ public function __construct(AbstractNode $parent, $alias)
parent::__construct($parent);
}
- public function getAlias()
+ public function getAlias()
{
return $this->alias;
}
View
2  lib/Doctrine/ODM/PHPCR/Query/Builder/OperandDynamicName.php
@@ -12,7 +12,7 @@ public function __construct(AbstractNode $parent, $alias)
parent::__construct($parent);
}
- public function getAlias()
+ public function getAlias()
{
return $this->alias;
}
View
1  lib/Doctrine/ODM/PHPCR/Query/Builder/OperandFactory.php
@@ -2,7 +2,6 @@
namespace Doctrine\ODM\PHPCR\Query\Builder;
-
/**
* Factory node for all operands, both dynamic and static.
*
View
1  lib/Doctrine/ODM/PHPCR/Query/Builder/OperandStaticFactory.php
@@ -2,7 +2,6 @@
namespace Doctrine\ODM\PHPCR\Query\Builder;
-
/**
* Factory node for static operands.
*
View
2  lib/Doctrine/ODM/PHPCR/Query/Builder/OperandStaticLiteral.php
@@ -12,7 +12,7 @@ public function __construct(AbstractNode $parent, $value)
parent::__construct($parent);
}
- public function getValue()
+ public function getValue()
{
return $this->value;
}
View
2  lib/Doctrine/ODM/PHPCR/Query/Builder/OperandStaticParameter.php
@@ -12,7 +12,7 @@ public function __construct(AbstractNode $parent, $variableName)
parent::__construct($parent);
}
- public function getVariableName()
+ public function getVariableName()
{
return $this->variableName;
}
View
1  lib/Doctrine/ODM/PHPCR/Query/Builder/OrderByAdd.php
@@ -2,7 +2,6 @@
namespace Doctrine\ODM\PHPCR\Query\Builder;
-
/**
* Node for adding an additional order by.
*
View
1  lib/Doctrine/ODM/PHPCR/Query/Builder/QueryBuilder.php
@@ -3,7 +3,6 @@
namespace Doctrine\ODM\PHPCR\Query\Builder;
use PHPCR\Query\QOM\QueryObjectModelConstantsInterface as QOMConstants;
-
use Doctrine\ODM\PHPCR\Query\Query;
use Doctrine\ODM\PHPCR\Query\Builder\AbstractNode as QBConstants;
use Doctrine\ODM\PHPCR\Exception\RuntimeException;
View
1  lib/Doctrine/ODM/PHPCR/Query/Builder/Select.php
@@ -43,4 +43,3 @@ public function getNodeType()
return self::NT_SELECT;
}
}
-
View
1  lib/Doctrine/ODM/PHPCR/Query/Builder/SelectAdd.php
@@ -10,4 +10,3 @@
class SelectAdd extends Select
{
}
-
View
4 lib/Doctrine/ODM/PHPCR/Query/Builder/SourceJoinConditionChildDocument.php
@@ -19,12 +19,12 @@ public function getNodeType()
return self::NT_SOURCE_JOIN_CONDITION;
}
- public function getChildAlias()
+ public function getChildAlias()
{
return $this->childAlias;
}
- public function getParentAlias()
+ public function getParentAlias()
{
return $this->parentAlias;
}
View
1  lib/Doctrine/ODM/PHPCR/Query/Builder/SourceJoinConditionEqui.php
@@ -45,4 +45,3 @@ public function getAlias2()
return $this->alias2;
}
}
-
View
8 lib/Doctrine/ODM/PHPCR/Query/Builder/SourceJoinConditionSameDocument.php
@@ -2,7 +2,6 @@
namespace Doctrine\ODM\PHPCR\Query\Builder;
-
class SourceJoinConditionSameDocument extends AbstractLeafNode
{
protected $alias1Name;
@@ -22,19 +21,18 @@ public function getNodeType()
return self::NT_SOURCE_JOIN_CONDITION;
}
- public function getAlias1Name()
+ public function getAlias1Name()
{
return $this->alias1Name;
}
- public function getAlias2Name()
+ public function getAlias2Name()
{
return $this->alias2Name;
}
- public function getAlias2Path()
+ public function getAlias2Path()
{
return $this->alias2Path;
}
-
}
View
1  lib/Doctrine/ODM/PHPCR/Query/Builder/SourceJoinLeft.php
@@ -2,7 +2,6 @@
namespace Doctrine\ODM\PHPCR\Query\Builder;
-
/**
* Factory node for "left" source in join.
*
View
1  lib/Doctrine/ODM/PHPCR/Query/Builder/SourceJoinRight.php
@@ -2,7 +2,6 @@
namespace Doctrine\ODM\PHPCR\Query\Builder;
-
/**
* Factory node for "right" source in join.
*
View
1  lib/Doctrine/ODM/PHPCR/Query/Expression/SameNode.php
@@ -23,4 +23,3 @@ public function visit(ExpressionVisitor $visitor)
{
}
}
-
View
2  lib/Doctrine/ODM/PHPCR/Repository/DefaultRepositoryFactory.php
@@ -74,4 +74,4 @@ protected function createRepository(DocumentManagerInterface $dm, $documentName)
return new $repositoryClassName($dm, $metadata);
}
-}
+}
View
2  lib/Doctrine/ODM/PHPCR/Repository/RepositoryFactory.php
@@ -37,4 +37,4 @@
* @return \Doctrine\Common\Persistence\ObjectRepository
*/
public function getRepository(DocumentManagerInterface $dm, $documentName);
-}
+}
View
2  lib/Doctrine/ODM/PHPCR/Tools/Console/Command/DocumentMigrateClassCommand.php
@@ -21,7 +21,6 @@
use Doctrine\ODM\PHPCR\DocumentManager;
use PHPCR\Util\Console\Command\NodesUpdateCommand;
-
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
@@ -93,4 +92,3 @@ function ($session, $node) use ($newClassname, $documentManager, $mapper) {
return parent::execute($input, $output);
}
}
-
View
3  lib/Doctrine/ODM/PHPCR/Tools/Console/Command/DumpQueryBuilderReferenceCommand.php
@@ -18,6 +18,7 @@
*/
namespace Doctrine\ODM\PHPCR\Tools\Console\Command;
+
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
@@ -137,7 +138,7 @@ protected function formatMapRst($map)
$nti[] = $f['genAnc']($nType, 'type');
$nti[] = '';
$nti[] = $f['humanize']($nType);
- $nti[] = $f['underline']($nType, '~');;
+ $nti[] = $f['underline']($nType, '~');
$nti[] = '';
foreach ($nClasses as $nClass) {
View
10 lib/Doctrine/ODM/PHPCR/Tools/Console/Command/GenerateProxiesCommand.php
@@ -25,7 +25,6 @@
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
-
use Doctrine\ODM\PHPCR\Tools\Console\MetadataFilter;
/**
@@ -82,23 +81,23 @@ protected function execute(InputInterface $input, OutputInterface $output)
$destPath = $documentManager->getConfiguration()->getProxyDir();
}
- if ( ! is_dir($destPath)) {
+ if (! is_dir($destPath)) {
mkdir($destPath, 0777, true);
}
$destPath = realpath($destPath);
- if ( ! file_exists($destPath)) {
+ if (! file_exists($destPath)) {
throw new \InvalidArgumentException(
sprintf("Proxies destination directory '<info>%s</info>' does not exist.", $documentManager->getConfiguration()->getProxyDir())
);
- } else if ( ! is_writable($destPath)) {
+ } elseif (! is_writable($destPath)) {
throw new \InvalidArgumentException(
sprintf("Proxies destination directory '<info>%s</info>' does not have write permissions.", $destPath)
);
}
- if ( count($metadatas)) {
+ if (count($metadatas)) {
foreach ($metadatas as $metadata) {
$output->write(
sprintf('Processing entity "<info>%s</info>"', $metadata->name) . PHP_EOL
@@ -113,6 +112,5 @@ protected function execute(InputInterface $input, OutputInterface $output)
} else {
$output->write('No Metadata Classes to process.' . PHP_EOL);
}
-
}
}
View
2  lib/Doctrine/ODM/PHPCR/Tools/Console/Command/RegisterSystemNodeTypesCommand.php
@@ -22,9 +22,7 @@
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
-
use PHPCR\Util\Console\Command\NodeTypeRegisterCommand;
-
use Doctrine\ODM\PHPCR\Translation\Translation;
/**
View
1  lib/Doctrine/ODM/PHPCR/Tools/Console/Helper/DocumentManagerHelper.php
@@ -20,7 +20,6 @@
namespace Doctrine\ODM\PHPCR\Tools\Console\Helper;
use Doctrine\ODM\PHPCR\DocumentManagerInterface;
-
use PHPCR\Util\Console\Helper\PhpcrHelper;
use PHPCR\SessionInterface;
View
2  lib/Doctrine/ODM/PHPCR/Tools/Console/MetadataFilter.php
@@ -47,7 +47,7 @@ class MetadataFilter extends \FilterIterator implements \Countable
*
* @return array
*/
- static public function filter(array $metadatas, $filter)
+ public static function filter(array $metadatas, $filter)
{
$metadatas = new MetadataFilter(new \ArrayIterator($metadatas), $filter);
View
1  lib/Doctrine/ODM/PHPCR/Tools/Helper/PrefetchHelper.php
@@ -134,5 +134,4 @@ public function collectPrefetchHierarchy(ClassMetadata $class, NodeInterface $no
return $prefetch;
}
-
}
View
2  lib/Doctrine/ODM/PHPCR/Tools/Test/QueryBuilderTester.php
@@ -150,7 +150,7 @@ public function getAllNodes(AbstractNode $node = null)
}
foreach ($node->getChildren() as $child) {
- $nodes[] = $child;
+ $nodes[] = $child;
if (!$child instanceof AbstractLeafNode) {
$nodes = array_merge($nodes, $this->getAllNodes($child));
}
View
1  lib/Doctrine/ODM/PHPCR/Translation/LocaleChooser/LocaleChooser.php
@@ -178,5 +178,4 @@ public function getDefaultLocale()
{
return $this->defaultLocale;
}
-
}
View
5 lib/Doctrine/ODM/PHPCR/Translation/TranslationStrategy/AttributeTranslationStrategy.php
@@ -19,9 +19,8 @@
namespace Doctrine\ODM\PHPCR\Translation\TranslationStrategy;
-use Doctrine\ODM\PHPCR\Mapping\ClassMetadata,
- PHPCR\NodeInterface;
-
+use Doctrine\ODM\PHPCR\Mapping\ClassMetadata;
+use PHPCR\NodeInterface;
use Doctrine\ODM\PHPCR\Translation\Translation;
use PHPCR\Query\QOM\ConstraintInterface;
use PHPCR\Query\QOM\QueryObjectModelFactoryInterface;
View
3  lib/Doctrine/ODM/PHPCR/Translation/TranslationStrategy/TranslationNodesWarmer.php
@@ -26,5 +26,4 @@
* @return mixed
*/
public function getTranslationsForNodes($nodes, $locales, SessionInterface $session);
-
-}
+}
View
1  lib/Doctrine/ODM/PHPCR/Translation/TranslationStrategy/TranslationStrategyInterface.php
@@ -127,5 +127,4 @@ public function alterQueryForTranslation(
$alias,
$locale
);
-
}
View
12 lib/Doctrine/ODM/PHPCR/UnitOfWork.php
@@ -26,7 +26,6 @@
use Doctrine\Common\Proxy\Proxy;
use Doctrine\Common\Collections\Collection;
use Doctrine\Common\Util\ClassUtils;
-
use Doctrine\ODM\PHPCR\Event\ListenersInvoker;
use Doctrine\ODM\PHPCR\Event\PreUpdateEventArgs;
use Doctrine\ODM\PHPCR\Event\MoveEventArgs;
@@ -42,7 +41,6 @@
use Doctrine\ODM\PHPCR\Tools\Helper\PrefetchHelper;
use Doctrine\ODM\PHPCR\Translation\MissingTranslationException;
use Doctrine\ODM\PHPCR\Translation\TranslationStrategy\TranslationNodesWarmer;
-
use Iterator;
use PHPCR\RepositoryInterface;
use PHPCR\PropertyType;
@@ -55,7 +53,6 @@
use PHPCR\Util\UUIDHelper;
use PHPCR\Util\PathHelper;
use PHPCR\Util\NodeHelper;
-
use Jackalope\Session as JackalopeSession;
/**
@@ -401,7 +398,7 @@ public function getOrCreateDocuments($className, $nodes, array &$hints = array()
try {
$this->validateClassName($document, $requestedClassName);
- } catch(ClassMismatchException $e) {
+ } catch (ClassMismatchException $e) {
continue;
}
} else {
@@ -898,7 +895,7 @@ private function cascadeScheduleParentInsert($class, $document, &$visited)
$class->parentMapping,
self::objToStr($document, $this->dm)
));
- }
+ }
$this->doScheduleInsert($parent, $visited);
}
@@ -1712,7 +1709,7 @@ private function computeReferenceChanges($mapping, $reference)
switch ($state) {
case self::STATE_NEW:
- if (!($mapping['cascade'] & ClassMetadata::CASCADE_PERSIST) ) {
+ if (!($mapping['cascade'] & ClassMetadata::CASCADE_PERSIST)) {
throw CascadeException::newDocumentFound(self::objToStr($reference));
}
$this->persistNew($targetClass, $reference);
@@ -1736,7 +1733,7 @@ private function computeReferrerChanges($mapping, $referrer)
switch ($state) {
case self::STATE_NEW:
- if (!($mapping['cascade'] & ClassMetadata::CASCADE_PERSIST) ) {
+ if (!($mapping['cascade'] & ClassMetadata::CASCADE_PERSIST)) {
throw CascadeException::newDocumentFound(self::objToStr($referrer));
}
$this->persistNew($targetClass, $referrer);
@@ -3749,7 +3746,6 @@ private function setMixins(Mapping\ClassMetadata $metadata, NodeInterface $node,
// manually set the uuid if it is not present yet, so we can assign it to documents
if ($node->isNodeType('mix:referenceable') && !$node->hasProperty('jcr:uuid')) {
-
$uuid = false;
$uuidFieldName = $metadata->getUuidFieldName();
View
1  tests/Doctrine/Tests/Models/Blog/Comment.php
@@ -21,4 +21,3 @@ class Comment
/** @PHPCRODM\Field(type="string") */
public $title;
}
-
View
1  tests/Doctrine/Tests/Models/Blog/User.php
@@ -23,4 +23,3 @@ class User
/** @PHPCRODM\Field(type="string") */
public $status;
}
-
View
8 tests/Doctrine/Tests/Models/CMS/CmsArticle.php
@@ -26,7 +26,7 @@ class CmsArticle
/** @PHPCRODM\Field(type="binary", nullable=true) */
public $attachments;
- function __construct()
+ public function __construct()
{
$this->persons = new ArrayCollection();
}
@@ -39,7 +39,8 @@ public function setAuthor(CmsUser $author)
/**
* @param CmsArticlePerson $person
*/
- public function addPerson(CmsArticlePerson $person){
+ public function addPerson(CmsArticlePerson $person)
+ {
$this->persons->add($person);
}
@@ -58,7 +59,4 @@ public function getPersons()
{
return $this->persons;
}
-
-
-
}
View
1  tests/Doctrine/Tests/Models/CMS/CmsArticlePerson.php
@@ -71,7 +71,6 @@ public function getName()
{
return $this->name;
}
-
}
class CmsArticlePersonRepository extends DocumentRepository implements RepositoryIdInterface
View
1  tests/Doctrine/Tests/Models/CMS/CmsGroup.php
@@ -41,4 +41,3 @@ public function getUsers()
return $this->users;
}
}
-
View
4 tests/Doctrine/Tests/Models/CMS/CmsPage.php
@@ -68,8 +68,8 @@ public function addItem($item)
public function removeItem($item)
{
- foreach ($this->items as $key => $value){
- if ($value === $item){
+ foreach ($this->items as $key => $value) {
+ if ($value === $item) {
unset($this->items[$key]);
}
}
View
2  tests/Doctrine/Tests/Models/References/RefCascadeManyTestObj.php
@@ -18,6 +18,6 @@ class RefCascadeManyTestObj
public function __construct()
{
- $this->references = new \Doctrine\Common\Collections\ArrayCollection();
+ $this->references = new \Doctrine\Common\Collections\ArrayCollection();
}
}
View
2  tests/Doctrine/Tests/Models/References/RefManyTestObj.php
@@ -16,6 +16,6 @@ class RefManyTestObj
public function __construct()
{
- $this->references = new \Doctrine\Common\Collections\ArrayCollection();
+ $this->references = new \Doctrine\Common\Collections\ArrayCollection();
}
}
View
5 tests/Doctrine/Tests/Models/Translation/DerivedArticle.php
@@ -2,10 +2,11 @@
namespace Doctrine\Tests\Models\Translation;
use Doctrine\ODM\PHPCR\Mapping\Annotations as PHPCRODM;
-
use Doctrine\Tests\Models\Translation\Article;
/**
* @PHPCRODM\Document
*/
-class DerivedArticle extends Article {}
+class DerivedArticle extends Article
+{
+}
View
3  tests/Doctrine/Tests/Models/Versioning/FullVersionableArticleWithChildren.php
@@ -9,7 +9,6 @@
*/
class FullVersionableArticleWithChildren extends FullVersionableArticle
{
-
/**
* @PHPCRODM\Children
*/
@@ -24,4 +23,4 @@ public function addChildArticle(NonVersionableArticle $a)
{
$this->childArticles->add($a);
}
-}
+}
View
2  tests/Doctrine/Tests/ODM/PHPCR/ConfigurationTest.php
@@ -27,4 +27,4 @@ public function testDocumentNamespace()
$this->setExpectedException('Doctrine\ODM\PHPCR\PHPCRException');
$config->getDocumentNamespace('bar');
}
-}
+}
View
8 tests/Doctrine/Tests/ODM/PHPCR/DocumentClassMapperTest.php
@@ -244,6 +244,10 @@ public function testExpandClassName($className, $fqClassName, $isAlias)
}
}
-class BaseClass {}
+class BaseClass
+{
+}
-class ExtendingClass extends BaseClass {}
+class ExtendingClass extends BaseClass
+{
+}
View
1  tests/Doctrine/Tests/ODM/PHPCR/Event/MoveEventArgsTest.php
@@ -50,4 +50,3 @@ public function testGetTargetPath()
$this->assertEquals('target/path', $path);
}
}
-
View
1  tests/Doctrine/Tests/ODM/PHPCR/Functional/BasicCrudTest.php
@@ -7,7 +7,6 @@
use Doctrine\ODM\PHPCR\Exception\InvalidArgumentException;
use PHPCR\PropertyType;
use PHPCR\Util\UUIDHelper;
-
use Doctrine\ODM\PHPCR\Mapping\Annotations as PHPCRODM;
use PHPCR\Util\NodeHelper;
View
2  tests/Doctrine/Tests/ODM/PHPCR/Functional/CascadeRefreshTest.php
@@ -52,4 +52,4 @@ public function testCascadeRefresh()
$this->assertEquals("beberlei", $user->username);
$this->assertEquals("Test!", $group1->name);
}
-}
+}
View
4 tests/Doctrine/Tests/ODM/PHPCR/Functional/CascadeRemoveTest.php
@@ -31,7 +31,7 @@ public function setUp()
public function testCascadeRemoveBidirectionalFromOwningSide()
{
- $this->wrapRemove(function($dm, $user, $group1, $group2) {
+ $this->wrapRemove(function ($dm, $user, $group1, $group2) {
$dm->remove($user);
$dm->flush();
});
@@ -39,7 +39,7 @@ public function testCascadeRemoveBidirectionalFromOwningSide()
public function testCascadeRemoveFromInverseSide()
{
- $this->wrapRemove(function($dm, $user, $group1, $group2) {
+ $this->wrapRemove(function ($dm, $user, $group1, $group2) {
$dm->remove($group1);
$dm->flush();
});
View
1  tests/Doctrine/Tests/ODM/PHPCR/Functional/ChangesetCalculationTest.php
@@ -146,7 +146,6 @@ public function testComputeChangesetTranslatableFind()
$user1 = $this->dm->findTranslation(null, $user1->id, 'en');
$this->assertEquals('active', $user1->status);
-
}
}
View
1  tests/Doctrine/Tests/ODM/PHPCR/Functional/DocumentManagerTest.php
@@ -7,7 +7,6 @@
use Doctrine\Tests\ODM\PHPCR\PHPCRFunctionalTestCase;
use PHPCR\NodeInterface;
use PHPCR\Util\UUIDHelper;
-
use Doctrine\ODM\PHPCR\Mapping\Annotations as PHPCRODM;
class DocumentManagerTest extends PHPCRFunctionalTestCase
View
17 tests/Doctrine/Tests/ODM/PHPCR/Functional/EventManagerResetTest.php
@@ -3,11 +3,9 @@
namespace Doctrine\Tests\ODM\PHPCR\Functional;
use Doctrine\Common\Persistence\Event\LifecycleEventArgs;
-
use Doctrine\Tests\ODM\PHPCR\PHPCRFunctionalTestCase;
use Doctrine\Tests\Models\CMS\CmsPage;
-
/**
* These tests ensure that you can reset a value in a lifecycle event
*
@@ -84,11 +82,10 @@ public function testResetEvents()
class TestResetListener
{
-
public function prePersist(LifecycleEventArgs $e)
{
$document = $e->getObject();
- if ($document instanceof CmsPage && $document->content instanceof CmsPageContent){
+ if ($document instanceof CmsPage && $document->content instanceof CmsPageContent) {
$contentReference = array('id' => $document->content->id);
$document->content = serialize($contentReference);
}
@@ -97,10 +94,10 @@ public function prePersist(LifecycleEventArgs $e)
public function postPersist(LifecycleEventArgs $e)
{
$document = $e->getObject();
- if ($document instanceof CmsPage){
+ if ($document instanceof CmsPage) {
$contentReference = unserialize($document->content);
- if ($contentReference !== false && isset($contentReference['id'])){
+ if ($contentReference !== false && isset($contentReference['id'])) {
// Load real object using $contentReference['id']
$pageContent = new CmsPageContent();
@@ -114,11 +111,11 @@ public function postPersist(LifecycleEventArgs $e)
public function preUpdate(LifecycleEventArgs $e)
{
$document = $e->getObject();
- if ($document instanceof CmsPage && $document->title !== 'my-page'){
+ if ($document instanceof CmsPage && $document->title !== 'my-page') {
$document->title = 'my-page';
}
- if ($document instanceof CmsPage && $document->content instanceof CmsPageContent){
+ if ($document instanceof CmsPage && $document->content instanceof CmsPageContent) {
$contentReference = array('id' => $document->content->id);
$document->content = serialize($contentReference);
}
@@ -127,10 +124,10 @@ public function preUpdate(LifecycleEventArgs $e)
public function postUpdate(LifecycleEventArgs $e)
{
$document = $e->getObject();
- if ($document instanceof CmsPage){
+ if ($document instanceof CmsPage) {
$contentReference = unserialize($document->content);
- if ($contentReference !== false && isset($contentReference['id'])){
+ if ($contentReference !== false && isset($contentReference['id'])) {
// Load real object using $contentReference['id']
$pageContent = new CmsPageContent();
View
28 tests/Doctrine/Tests/ODM/PHPCR/Functional/EventManagerTest.php
@@ -5,9 +5,7 @@
use Doctrine\Common\Persistence\Event\LifecycleEventArgs;
use Doctrine\Common\Persistence\Event\ManagerEventArgs;
use Doctrine\ODM\PHPCR\Event\PreUpdateEventArgs;
-
use Doctrine\ODM\PHPCR\Event\MoveEventArgs;
-
use Doctrine\ODM\PHPCR\Event;
use Doctrine\ODM\PHPCR\Translation\LocaleChooser\LocaleChooser;
use Doctrine\Tests\Models\CMS\CmsPageTranslatable;
@@ -231,9 +229,9 @@ class TestPersistenceListener
public function prePersist(LifecycleEventArgs $e)
{
$document = $e->getObject();
- if ($document instanceof CmsPage){
+ if ($document instanceof CmsPage) {
$this->pagePrePersist = true;
- } elseif ($document instanceof CmsItem){
+ } elseif ($document instanceof CmsItem) {
$this->itemPrePersist = true;
}
}
@@ -241,9 +239,9 @@ public function prePersist(LifecycleEventArgs $e)
public function postPersist(LifecycleEventArgs $e)
{
$document = $e->getObject();
- if ($document instanceof CmsPage){
+ if ($document instanceof CmsPage) {
$this->pagePostPersist = true;
- } elseif ($document instanceof CmsItem){
+ } elseif ($document instanceof CmsItem) {
$this->itemPostPersist = true;
}
}
@@ -251,7 +249,7 @@ public function postPersist(LifecycleEventArgs $e)
public function preUpdate(PreUpdateEventArgs $e)
{
$document = $e->getObject();
- if (! $document instanceof CmsPage ){
+ if (! $document instanceof CmsPage) {
return;
}
$dm = $e->getObjectManager();
@@ -275,9 +273,9 @@ public function postUpdate(LifecycleEventArgs $e)
public function preRemove(LifecycleEventArgs $e)
{
$document = $e->getObject();
- if ($document instanceof CmsPage){
+ if ($document instanceof CmsPage) {
$this->pagePreRemove = true;
- } elseif ($document instanceof CmsItem){
+ } elseif ($document instanceof CmsItem) {
$this->itemPreRemove = true;
}
}
@@ -285,9 +283,9 @@ public function preRemove(LifecycleEventArgs $e)
public function postRemove(LifecycleEventArgs $e)
{
$document = $e->getObject();
- if ($document instanceof CmsPage){
+ if ($document instanceof CmsPage) {
$this->pagePostRemove = true;
- } elseif ($document instanceof CmsItem){
+ } elseif ($document instanceof CmsItem) {
$this->itemPostRemove = true;
}
}
@@ -295,9 +293,9 @@ public function postRemove(LifecycleEventArgs $e)
public function preMove(MoveEventArgs $e)
{
$document = $e->getObject();
- if ($document instanceof CmsPage){
+ if ($document instanceof CmsPage) {
$this->pagePreMove = true;
- } elseif ($document instanceof CmsItem){
+ } elseif ($document instanceof CmsItem) {
$this->itemPreMove = true;
}
}
@@ -305,9 +303,9 @@ public function preMove(MoveEventArgs $e)
public function postMove(LifecycleEventArgs $e)
{
$document = $e->getObject();
- if ($document instanceof CmsPage){
+ if ($document instanceof CmsPage) {
$this->pagePostMove = true;
- } elseif ($document instanceof CmsItem){
+ } elseif ($document instanceof CmsItem) {
$this->itemPostMove = true;
}
}
View
1  tests/Doctrine/Tests/ODM/PHPCR/Functional/FindTypeValidationTest.php
@@ -6,7 +6,6 @@
use Doctrine\ODM\PHPCR\DocumentRepository;
use Doctrine\ODM\PHPCR\Exception\InvalidArgumentException;
use PHPCR\PropertyType;
-
use Doctrine\ODM\PHPCR\Mapping\Annotations as PHPCRODM;
/**
View
1  tests/Doctrine/Tests/ODM/PHPCR/Functional/FixPHPCR1Test.php
@@ -49,7 +49,6 @@ public function testCreateFromFile()
$this->assertTrue($this->node->getNode('filetest')->getNode('file')->hasNode('jcr:content'));
$this->assertTrue($this->node->getNode('filetest')->getNode('file')->getNode('jcr:content')->hasProperty('jcr:data'));
}
-
}
/**
View
1  tests/Doctrine/Tests/ODM/PHPCR/Functional/FlushTest.php
@@ -3,7 +3,6 @@
namespace Doctrine\Tests\ODM\PHPCR\Functional;
use Doctrine\ODM\PHPCR\Mapping\Annotations as PHPCRODM;
-
use Doctrine\Tests\Models\CMS\CmsGroup;
use Doctrine\Tests\Models\CMS\CmsUser;
use Doctrine\Tests\Models\CMS\CmsTeamUser;
View
1  tests/Doctrine/Tests/ODM/PHPCR/Functional/FolderFileTest.php
@@ -4,7 +4,6 @@
use Doctrine\ODM\PHPCR\Document\File;
use Doctrine\ODM\PHPCR\Document\Folder;
-
use Doctrine\Tests\ODM\PHPCR\PHPCRFunctionalTestCase;
use PHPCR\NodeInterface;
View
26 tests/Doctrine/Tests/ODM/PHPCR/Functional/Hierarchy/ChildTest.php
@@ -72,7 +72,7 @@ public function testInsertWithUnnamedChild()
/**
* @depends testInsertWithUnnamedChild
*/
- function testProxyForChildIsUsed()
+ public function testProxyForChildIsUsed()
{
$parent = new ChildTestObj();
$child = new ChildChildTestObj();
@@ -471,14 +471,14 @@ class ChildTestObj
*/
class ChildReferrerTestObj
{
- /** @PHPCRODM\Id */
- public $id;
+ /** @PHPCRODM\Id */
+ public $id;
- /** @PHPCRODM\Field(type="string") */
- public $name;
+ /** @PHPCRODM\Field(type="string") */
+ public $name;
- /** @PHPCRODM\ReferenceOne(targetDocument="ChildReferenceableTestObj", cascade="persist") */
- public $reference;
+ /** @PHPCRODM\ReferenceOne(targetDocument="ChildReferenceableTestObj", cascade="persist") */
+ public $reference;
}
/**
@@ -486,12 +486,12 @@ class ChildReferrerTestObj
*/
class ChildReferenceableTestObj
{
- /** @PHPCRODM\Id */
- public $id;
+ /** @PHPCRODM\Id */
+ public $id;
- /** @PHPCRODM\Field(type="string") */
- public $name;
+ /** @PHPCRODM\Field(type="string") */
+ public $name;
- /** @PHPCRODM\Child(nodeName="test", cascade="persist") */
- public $aChild;
+ /** @PHPCRODM\Child(nodeName="test", cascade="persist") */
+ public $aChild;
}
View
28 tests/Doctrine/Tests/ODM/PHPCR/Functional/Hierarchy/ChildrenTest.php
@@ -8,10 +8,8 @@
use Doctrine\Tests\ODM\PHPCR\PHPCRFunctionalTestCase;
use PHPCR\NodeInterface;
use PHPCR\RepositoryInterface;
-
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Persistence\Event\LifecycleEventArgs;
-
use Doctrine\ODM\PHPCR\Mapping\Annotations as PHPCR;
/**
@@ -795,14 +793,14 @@ class ChildrenParentAndNameTestObj
*/
class ChildrenReferrerTestObj
{
- /** @PHPCR\Id */
- public $id;
+ /** @PHPCR\Id */
+ public $id;
- /** @PHPCR\Field(type="string") */
- public $name;
+ /** @PHPCR\Field(type="string") */
+ public $name;
- /** @PHPCR\ReferenceOne(targetDocument="ChildrenReferenceableTestObj", cascade="persist") */
- public $reference;
+ /** @PHPCR\ReferenceOne(targetDocument="ChildrenReferenceableTestObj", cascade="persist") */
+ public $reference;
}
/**
@@ -810,14 +808,14 @@ class ChildrenReferrerTestObj
*/
class ChildrenReferenceableTestObj
{
- /** @PHPCR\Id */
- public $id;
+ /** @PHPCR\Id */
+ public $id;
- /** @PHPCR\Field(type="string") */
- public $name;
+ /** @PHPCR\Field(type="string") */
+ public $name;
- /** @PHPCR\Children(cascade="persist") */
- public $allChildren;
+ /** @PHPCR\Children(cascade="persist") */
+ public $allChildren;
}
class TestResetReorderingListener
@@ -825,7 +823,7 @@ class TestResetReorderingListener
public function preUpdate(LifecycleEventArgs $e)
{
$document = $e->getObject();
- if ($document instanceof ChildrenTestObj && $document->allChildren->first()->name ===