@@ -17,6 +17,9 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | class StingerSoftEntitySearchBundle extends Bundle { |
| 19 | 19 | |
| 20 | + /** |
|
| 21 | + * @param string $env |
|
| 22 | + */ |
|
| 20 | 23 | public static function getRequiredBundles($env) { |
| 21 | 24 | $bundles = array(); |
| 22 | 25 | $bundles['StingerSoftEntitySearchBundle'] = '\StingerSoft\EntitySearchBundle\StingerSoftEntitySearchBundle'; |
@@ -116,7 +116,7 @@ |
||
| 116 | 116 | $view = $form->createView(); |
| 117 | 117 | $children = $view->children; |
| 118 | 118 | |
| 119 | - foreach(array_keys($formData) as $key) { |
|
| 119 | + foreach (array_keys($formData) as $key) { |
|
| 120 | 120 | $this->assertArrayHasKey($key, $children); |
| 121 | 121 | } |
| 122 | 122 | |
@@ -25,9 +25,9 @@ discard block |
||
| 25 | 25 | |
| 26 | 26 | /** |
| 27 | 27 | * |
| 28 | - * @param number $save |
|
| 28 | + * @param integer $save |
|
| 29 | 29 | * Number of expected saves |
| 30 | - * @param number $delete |
|
| 30 | + * @param integer $delete |
|
| 31 | 31 | * Number of expected deletions |
| 32 | 32 | */ |
| 33 | 33 | protected function registerDoctrineListener($save = 0, $delete = 0) { |
@@ -50,9 +50,9 @@ discard block |
||
| 50 | 50 | |
| 51 | 51 | /** |
| 52 | 52 | * |
| 53 | - * @param number $save |
|
| 53 | + * @param integer $save |
|
| 54 | 54 | * Number of expected saves |
| 55 | - * @param number $delete |
|
| 55 | + * @param integer $delete |
|
| 56 | 56 | * Number of expected deletions |
| 57 | 57 | */ |
| 58 | 58 | protected function registerSearchService($save = 0, $delete = 0) { |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | ); |
| 45 | 45 | $config = null === $config ? $this->getMockAnnotatedConfig() : $config; |
| 46 | 46 | $em = EntityManager::create($conn, $config, $evm ?: $this->getEventManager()); |
| 47 | - $schema = array_map(function ($class) use ($em) { |
|
| 47 | + $schema = array_map(function($class) use ($em) { |
|
| 48 | 48 | return $em->getClassMetadata($class); |
| 49 | 49 | }, (array)$this->getUsedEntityFixtures()); |
| 50 | 50 | $schemaTool = new SchemaTool($em); |
@@ -69,13 +69,13 @@ discard block |
||
| 69 | 69 | $refl = new \ReflectionClass($configurationClass); |
| 70 | 70 | $methods = $refl->getMethods(); |
| 71 | 71 | $mockMethods = array(); |
| 72 | - foreach($methods as $method) { |
|
| 73 | - if($method->name !== 'addFilter' && $method->name !== 'getFilterClassName') { |
|
| 72 | + foreach ($methods as $method) { |
|
| 73 | + if ($method->name !== 'addFilter' && $method->name !== 'getFilterClassName') { |
|
| 74 | 74 | $mockMethods[] = $method->name; |
| 75 | 75 | } |
| 76 | 76 | } |
| 77 | 77 | $config = $this->getMockBuilder($configurationClass)->setMethods($mockMethods)->getMock(); |
| 78 | - $config->expects($this->once())->method('getProxyDir')->will($this->returnValue(__DIR__ . '/../../temp')); |
|
| 78 | + $config->expects($this->once())->method('getProxyDir')->will($this->returnValue(__DIR__.'/../../temp')); |
|
| 79 | 79 | $config->expects($this->once())->method('getProxyNamespace')->will($this->returnValue('Proxy')); |
| 80 | 80 | $config->expects($this->any())->method('getDefaultQueryHints')->will($this->returnValue(array())); |
| 81 | 81 | $config->expects($this->once())->method('getAutoGenerateProxyClasses')->will($this->returnValue(true)); |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | /** |
| 62 | 62 | * Get annotation mapping configuration |
| 63 | 63 | * |
| 64 | - * @return \Doctrine\ORM\Configuration |
|
| 64 | + * @return \PHPUnit\Framework\MockObject\MockObject |
|
| 65 | 65 | */ |
| 66 | 66 | protected function getMockAnnotatedConfig() { |
| 67 | 67 | // We need to mock every method except the ones which |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | /** |
| 94 | 94 | * Creates default mapping driver |
| 95 | 95 | * |
| 96 | - * @return \Doctrine\ORM\Mapping\Driver\Driver |
|
| 96 | + * @return AnnotationDriver |
|
| 97 | 97 | */ |
| 98 | 98 | protected function getMetadataDriverImplementation() { |
| 99 | 99 | return new AnnotationDriver($_ENV['annotation_reader'], $this->getPaths()); |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | // application.php |
| 3 | -require __DIR__ . '/../vendor/autoload.php'; |
|
| 3 | +require __DIR__.'/../vendor/autoload.php'; |
|
| 4 | 4 | |
| 5 | 5 | use StingerSoft\EntitySearchBundle\Command\ClearIndexCommand; |
| 6 | 6 | use StingerSoft\EntitySearchBundle\Command\SyncCommand; |
@@ -94,6 +94,7 @@ discard block |
||
| 94 | 94 | * The name of the field |
| 95 | 95 | * @param mixed $value |
| 96 | 96 | * The value of this field |
| 97 | + * @return void |
|
| 97 | 98 | */ |
| 98 | 99 | public function addField(string $fieldName, $value): void; |
| 99 | 100 | |
@@ -122,6 +123,7 @@ discard block |
||
| 122 | 123 | * The name of the field |
| 123 | 124 | * @param mixed $value |
| 124 | 125 | * The additional value of this field |
| 126 | + * @return void |
|
| 125 | 127 | */ |
| 126 | 128 | public function addMultiValueField(string $fieldName, $value): void; |
| 127 | 129 | |
@@ -133,6 +135,7 @@ discard block |
||
| 133 | 135 | * |
| 134 | 136 | * @param string $clazz |
| 135 | 137 | * The classname |
| 138 | + * @return void |
|
| 136 | 139 | */ |
| 137 | 140 | public function setEntityClass(string $clazz): void; |
| 138 | 141 | |
@@ -152,6 +155,7 @@ discard block |
||
| 152 | 155 | * |
| 153 | 156 | * @param mixed $id |
| 154 | 157 | * The ID of the corresponding entity |
| 158 | + * @return void |
|
| 155 | 159 | */ |
| 156 | 160 | public function setEntityId($id): void; |
| 157 | 161 | |
@@ -168,6 +172,7 @@ discard block |
||
| 168 | 172 | * hiding some programatically needed complexity from the user |
| 169 | 173 | * |
| 170 | 174 | * @param string $type |
| 175 | + * @return void |
|
| 171 | 176 | */ |
| 172 | 177 | public function setEntityType(string $type): void; |
| 173 | 178 | |
@@ -178,7 +183,6 @@ discard block |
||
| 178 | 183 | * |
| 179 | 184 | * If no entity type is set, the class will be used instead |
| 180 | 185 | * |
| 181 | - * @param string $type |
|
| 182 | 186 | */ |
| 183 | 187 | public function getEntityType(): string; |
| 184 | 188 | |
@@ -188,6 +192,7 @@ discard block |
||
| 188 | 192 | * <strong>note:</strong> This may not supported by the underlying implementation |
| 189 | 193 | * |
| 190 | 194 | * @param string $path |
| 195 | + * @return void |
|
| 191 | 196 | */ |
| 192 | 197 | public function setFile(string $path): void; |
| 193 | 198 | |
@@ -106,7 +106,7 @@ |
||
| 106 | 106 | * |
| 107 | 107 | * @param string $name |
| 108 | 108 | * Name of the property to set |
| 109 | - * @param mixed $value |
|
| 109 | + * @param string[] $value |
|
| 110 | 110 | * The value of the property |
| 111 | 111 | */ |
| 112 | 112 | public function __set($name, $value): void { |
@@ -92,10 +92,10 @@ discard block |
||
| 92 | 92 | * @return array |
| 93 | 93 | */ |
| 94 | 94 | public function __get($name) { |
| 95 | - if(strrpos($name, 'facet_', -strlen($name)) !== false) { |
|
| 95 | + if (strrpos($name, 'facet_', -strlen($name)) !== false) { |
|
| 96 | 96 | $facetname = substr($name, 6); |
| 97 | 97 | |
| 98 | - if(isset($this->facets[$facetname])) { |
|
| 98 | + if (isset($this->facets[$facetname])) { |
|
| 99 | 99 | return $this->facets[$facetname]; |
| 100 | 100 | } |
| 101 | 101 | return array(); |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | * The value of the property |
| 111 | 111 | */ |
| 112 | 112 | public function __set($name, $value): void { |
| 113 | - if(strrpos($name, 'facet_', -strlen($name)) !== false) { |
|
| 113 | + if (strrpos($name, 'facet_', -strlen($name)) !== false) { |
|
| 114 | 114 | $facetname = substr($name, 6); |
| 115 | 115 | $this->facets[$facetname] = $value; |
| 116 | 116 | } |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | * @return boolean |
| 124 | 124 | */ |
| 125 | 125 | public function __isset($name): bool { |
| 126 | - if(strrpos($name, 'facet_', -strlen($name)) !== false) { |
|
| 126 | + if (strrpos($name, 'facet_', -strlen($name)) !== false) { |
|
| 127 | 127 | return true; |
| 128 | 128 | } |
| 129 | 129 | |
@@ -40,5 +40,8 @@ |
||
| 40 | 40 | */ |
| 41 | 41 | public function getFacets(): array; |
| 42 | 42 | |
| 43 | + /** |
|
| 44 | + * @return void |
|
| 45 | + */ |
|
| 43 | 46 | public function addFacetValue(string $key, string $label, $value = null, int $increaseCounterBy = 1) : void; |
| 44 | 47 | } |
| 45 | 48 | \ No newline at end of file |
@@ -22,7 +22,6 @@ |
||
| 22 | 22 | /** |
| 23 | 23 | * Tries to create a document from the given object |
| 24 | 24 | * |
| 25 | - * @param object $object |
|
| 26 | 25 | * @return object Returns false if no document could be created |
| 27 | 26 | */ |
| 28 | 27 | public function getEntity(Document $document) : ?object; |