| @@ -19,7 +19,7 @@ | ||
| 19 | 19 | public function getFunctions() | 
| 20 | 20 |      { | 
| 21 | 21 | return array( | 
| 22 | -            new \Twig_SimpleFunction('render_location', array($this,'renderLocation'), array('is_safe' => array('html'))), | |
| 22 | +            new \Twig_SimpleFunction('render_location', array($this, 'renderLocation'), array('is_safe' => array('html'))), | |
| 23 | 23 | ); | 
| 24 | 24 | } | 
| 25 | 25 | |
| @@ -11,9 +11,9 @@ | ||
| 11 | 11 | public function __construct(eZRepository $repository, Content $content=null, Location $location=null); | 
| 12 | 12 | |
| 13 | 13 | /** | 
| 14 | - * Return the content of the current location | |
| 15 | - * @return \eZ\Publish\API\Repository\Values\Content\Content | |
| 16 | - */ | |
| 14 | + * Return the content of the current location | |
| 15 | + * @return \eZ\Publish\API\Repository\Values\Content\Content | |
| 16 | + */ | |
| 17 | 17 | public function content(); | 
| 18 | 18 | |
| 19 | 19 | /** | 
| @@ -8,7 +8,7 @@ | ||
| 8 | 8 | |
| 9 | 9 | interface EntityInterface | 
| 10 | 10 |  { | 
| 11 | - public function __construct(eZRepository $repository, Content $content=null, Location $location=null); | |
| 11 | + public function __construct(eZRepository $repository, Content $content = null, Location $location = null); | |
| 12 | 12 | |
| 13 | 13 | /** | 
| 14 | 14 | * Return the content of the current location | 
| @@ -29,7 +29,7 @@ discard block | ||
| 29 | 29 | * @param array $classMap array of classes exposing a RepositoryInterface | 
| 30 | 30 | * @param RepositoryManagerInterface[] $serviceMap array of services exposing a RepositoryInterface | 
| 31 | 31 | */ | 
| 32 | - public function __construct(eZRepository $repository, array $classMap=array(), array $serviceMap=array()) | |
| 32 | + public function __construct(eZRepository $repository, array $classMap = array(), array $serviceMap = array()) | |
| 33 | 33 |      { | 
| 34 | 34 | $this->repository = $repository; | 
| 35 | 35 |          foreach ($classMap as $contentTypeIdentifier => $className) { | 
| @@ -141,7 +141,7 @@ discard block | ||
| 141 | 141 | */ | 
| 142 | 142 | public function load($content) | 
| 143 | 143 |      { | 
| 144 | - switch(true) | |
| 144 | + switch (true) | |
| 145 | 145 |          { | 
| 146 | 146 | case $content instanceof ContentInfo: | 
| 147 | 147 | return $this | 
| @@ -156,7 +156,7 @@ discard block | ||
| 156 | 156 | ->getRepositoryByContentTypeId($content->contentInfo->contentTypeId) | 
| 157 | 157 | ->loadEntityFromLocation($content); | 
| 158 | 158 | } | 
| 159 | -        throw new \UnexpectedValueException("Can not load an Entity for php object of class " . get_class($content)); | |
| 159 | +        throw new \UnexpectedValueException("Can not load an Entity for php object of class ".get_class($content)); | |
| 160 | 160 | } | 
| 161 | 161 | |
| 162 | 162 | /** | 
| @@ -168,7 +168,7 @@ discard block | ||
| 168 | 168 | */ | 
| 169 | 169 | public function loadMany($contents) | 
| 170 | 170 |      { | 
| 171 | - switch(true) | |
| 171 | + switch (true) | |
| 172 | 172 |          { | 
| 173 | 173 | case $contents instanceof SearchResult: | 
| 174 | 174 | $entities = array(); | 
| @@ -183,7 +183,7 @@ discard block | ||
| 183 | 183 | } | 
| 184 | 184 | return $entities; | 
| 185 | 185 | } | 
| 186 | -        throw new \UnexpectedValueException("Can not load an Entities for php object of class " . get_class($contents)); | |
| 186 | +        throw new \UnexpectedValueException("Can not load an Entities for php object of class ".get_class($contents)); | |
| 187 | 187 | } | 
| 188 | 188 | |
| 189 | 189 | /** | 
| @@ -22,12 +22,12 @@ discard block | ||
| 22 | 22 | $relatedEntities = array(); | 
| 23 | 23 | |
| 24 | 24 | $fieldValue = $this->content()->getFieldValue($fieldName); | 
| 25 | -        if (! $fieldValue instanceof RelationList\Value) { | |
| 25 | +        if (!$fieldValue instanceof RelationList\Value) { | |
| 26 | 26 |              throw new \RuntimeException("Field '$fieldName' is not of type RelationList"); | 
| 27 | 27 | } | 
| 28 | 28 | |
| 29 | 29 | $relatedContentItems = array(); | 
| 30 | -        foreach($fieldValue->destinationContentIds as $contentId) { | |
| 30 | +        foreach ($fieldValue->destinationContentIds as $contentId) { | |
| 31 | 31 | // Just in case the object has been pu tin the trash or hidden and they have not updated the related fields to remove from view. | 
| 32 | 32 |              try { | 
| 33 | 33 | $relatedContentItems[] = $this->getRepository()->getContentService()->loadContent($contentId); | 
| @@ -49,7 +49,7 @@ discard block | ||
| 49 | 49 | protected function getRelation($fieldName) | 
| 50 | 50 |      { | 
| 51 | 51 | $fieldValue = $this->content()->getFieldValue($fieldName); | 
| 52 | -        if (! $fieldValue instanceof Relation\Value) { | |
| 52 | +        if (!$fieldValue instanceof Relation\Value) { | |
| 53 | 53 |              throw new \RuntimeException("Field '$fieldName' is not of type Relation"); | 
| 54 | 54 | } | 
| 55 | 55 | |
| @@ -65,7 +65,7 @@ discard block | ||
| 65 | 65 | */ | 
| 66 | 66 | protected $languages; | 
| 67 | 67 | |
| 68 | - public function __construct(eZRepository $repository, $entityManager, array $settings=array(), $contentTypeIdentifier='') | |
| 68 | + public function __construct(eZRepository $repository, $entityManager, array $settings = array(), $contentTypeIdentifier = '') | |
| 69 | 69 |      { | 
| 70 | 70 | $this->repository = $repository; | 
| 71 | 71 | $this->entityManager = $entityManager; | 
| @@ -85,7 +85,7 @@ discard block | ||
| 85 | 85 | return $this; | 
| 86 | 86 | } | 
| 87 | 87 | |
| 88 | - public function setLogger(LoggerInterface $logger=null) | |
| 88 | + public function setLogger(LoggerInterface $logger = null) | |
| 89 | 89 |      { | 
| 90 | 90 | $this->logger = $logger; | 
| 91 | 91 | return $this; | 
| @@ -121,7 +121,7 @@ discard block | ||
| 121 | 121 | */ | 
| 122 | 122 | public function __call($method, $args) | 
| 123 | 123 |      { | 
| 124 | -        switch($method) { | |
| 124 | +        switch ($method) { | |
| 125 | 125 | case 'emergency': | 
| 126 | 126 | case 'alert': | 
| 127 | 127 | case 'critical': | 
| @@ -42,7 +42,7 @@ discard block | ||
| 42 | 42 | * @param array $settings used to pass to the Entity instance anything that would be done via DIC if it was a service | 
| 43 | 43 | * @throws \InvalidArgumentException | 
| 44 | 44 | */ | 
| 45 | - public function __construct(eZRepository $repository, Content $content=null, Location $location=null, array $settings = array()) | |
| 45 | + public function __construct(eZRepository $repository, Content $content = null, Location $location = null, array $settings = array()) | |
| 46 | 46 |      { | 
| 47 | 47 |          if ($content == null && $location == null) { | 
| 48 | 48 |              throw new \InvalidArgumentException('Trying to create Entity with no content or location'); | 
| @@ -81,7 +81,7 @@ discard block | ||
| 81 | 81 | */ | 
| 82 | 82 | public function content() | 
| 83 | 83 |      { | 
| 84 | -        if($this->content == null){ | |
| 84 | +        if ($this->content == null) { | |
| 85 | 85 | $this->content = $this->repository->getContentService()->loadContent($this->location->contentId, $this->languages); | 
| 86 | 86 | } | 
| 87 | 87 | return $this->content; | 
| @@ -93,7 +93,7 @@ discard block | ||
| 93 | 93 | */ | 
| 94 | 94 | public function location() | 
| 95 | 95 |      { | 
| 96 | -        if($this->location == null){ | |
| 96 | +        if ($this->location == null) { | |
| 97 | 97 | $this->location = $this->repository->getLocationService()->loadLocation($this->content->contentInfo->mainLocationId); | 
| 98 | 98 | } | 
| 99 | 99 | return $this->location; |