Skip to content

Commit

Permalink
Merge cs-fixes-30 into cs-fixes-31
Browse files Browse the repository at this point in the history
  • Loading branch information
merk committed Mar 12, 2015
2 parents 14af748 + a8f41fa commit 345b5d4
Show file tree
Hide file tree
Showing 87 changed files with 525 additions and 543 deletions.
2 changes: 1 addition & 1 deletion Command/PopulateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use Symfony\Component\Console\Helper\ProgressBar;

/**
* Populate the search index
* Populate the search index.
*/
class PopulateCommand extends ContainerAwareCommand
{
Expand Down
2 changes: 1 addition & 1 deletion Command/ResetCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use FOS\ElasticaBundle\Resetter;

/**
* Reset search indexes
* Reset search indexes.
*/
class ResetCommand extends ContainerAwareCommand
{
Expand Down
2 changes: 1 addition & 1 deletion Command/SearchCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use Elastica\Result;

/**
* Searches a type
* Searches a type.
*/
class SearchCommand extends ContainerAwareCommand
{
Expand Down
6 changes: 4 additions & 2 deletions Configuration/IndexConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ class IndexConfig
/**
* Constructor expects an array as generated by the Container Configuration builder.
*
* @param string $name
* @param string $name
* @param TypeConfig[] $types
* @param array $config
* @param array $config
*/
public function __construct($name, array $types, array $config)
{
Expand Down Expand Up @@ -92,7 +92,9 @@ public function getSettings()

/**
* @param string $typeName
*
* @return TypeConfig
*
* @throws \InvalidArgumentException
*/
public function getType($typeName)
Expand Down
2 changes: 2 additions & 0 deletions Configuration/ManagerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ interface ManagerInterface
* Returns configuration for an index.
*
* @param $index
*
* @return IndexConfig
*/
public function getIndexConfiguration($index);
Expand All @@ -36,6 +37,7 @@ public function getIndexNames();
*
* @param string $index
* @param string $type
*
* @return TypeConfig
*/
public function getTypeConfiguration($index, $type);
Expand Down
3 changes: 2 additions & 1 deletion Configuration/Search.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@
* Annotation class for setting search repository.
*
* @Annotation
*
* @deprecated Use FOS\ElasticaBundle\Annotation\Search instead
* @Target("CLASS")
*/
class Search extends BaseSearch
{
}
}
1 change: 1 addition & 0 deletions Configuration/Source/ContainerSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public function getConfiguration()
* Builds TypeConfig objects for each type.
*
* @param array $config
*
* @return array
*/
protected function getTypes($config)
Expand Down
2 changes: 1 addition & 1 deletion Configuration/Source/SourceInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ interface SourceInterface
* @return \FOS\ElasticaBundle\Configuration\IndexConfig[]
*/
public function getConfiguration();
}
}
2 changes: 1 addition & 1 deletion DependencyInjection/Compiler/ConfigSourcePass.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ public function process(ContainerBuilder $container)

$container->getDefinition('fos_elastica.config_manager')->replaceArgument(0, $sources);
}
}
}
1 change: 1 addition & 0 deletions DependencyInjection/Compiler/RegisterProvidersPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public function process(ContainerBuilder $container)
* Returns whether the class implements ProviderInterface.
*
* @param string $class
*
* @return boolean
*/
private function isProviderImplementation($class)
Expand Down
2 changes: 1 addition & 1 deletion DependencyInjection/Compiler/TransformerPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function process(ContainerBuilder $container)
throw new InvalidArgumentException('The Transformer must have both a type and an index defined.');
}

$transformers[$tag['index']][$tag['type']]= new Reference($id);
$transformers[$tag['index']][$tag['type']] = new Reference($id);
}
}

Expand Down
28 changes: 14 additions & 14 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function getConfigTreeBuilder()
}

/**
* Adds the configuration for the "clients" key
* Adds the configuration for the "clients" key.
*/
private function addClientsSection(ArrayNodeDefinition $rootNode)
{
Expand All @@ -76,8 +76,8 @@ private function addClientsSection(ArrayNodeDefinition $rootNode)
->performNoDeepMerging()
// BC - Renaming 'servers' node to 'connections'
->beforeNormalization()
->ifTrue(function($v) { return isset($v['servers']); })
->then(function($v) {
->ifTrue(function ($v) { return isset($v['servers']); })
->then(function ($v) {
$v['connections'] = $v['servers'];
unset($v['servers']);

Expand All @@ -99,7 +99,7 @@ private function addClientsSection(ArrayNodeDefinition $rootNode)
->ifTrue(function ($v) { return is_array($v) && !array_key_exists('connections', $v); })
->then(function ($v) {
return array(
'connections' => array($v)
'connections' => array($v),
);
})
->end()
Expand All @@ -111,8 +111,8 @@ private function addClientsSection(ArrayNodeDefinition $rootNode)
->children()
->scalarNode('url')
->validate()
->ifTrue(function($url) { return $url && substr($url, -1) !== '/'; })
->then(function($url) { return $url.'/'; })
->ifTrue(function ($url) { return $url && substr($url, -1) !== '/'; })
->then(function ($url) { return $url.'/'; })
->end()
->end()
->scalarNode('host')->end()
Expand Down Expand Up @@ -143,7 +143,7 @@ private function addClientsSection(ArrayNodeDefinition $rootNode)
}

/**
* Adds the configuration for the "indexes" key
* Adds the configuration for the "indexes" key.
*/
private function addIndexesSection(ArrayNodeDefinition $rootNode)
{
Expand Down Expand Up @@ -198,8 +198,8 @@ protected function getTypesNode()
->end()
// BC - Renaming 'mappings' node to 'properties'
->beforeNormalization()
->ifTrue(function($v) { return array_key_exists('mappings', $v); })
->then(function($v) {
->ifTrue(function ($v) { return array_key_exists('mappings', $v); })
->then(function ($v) {
$v['properties'] = $v['mappings'];
unset($v['mappings']);

Expand Down Expand Up @@ -422,7 +422,7 @@ protected function getParentNode()
}

/**
* Returns the array node used for "_all"
* Returns the array node used for "_all".
*/
protected function getAllNode()
{
Expand All @@ -441,7 +441,7 @@ protected function getAllNode()
}

/**
* Returns the array node used for "_timestamp"
* Returns the array node used for "_timestamp".
*/
protected function getTimestampNode()
{
Expand All @@ -462,7 +462,7 @@ protected function getTimestampNode()
}

/**
* Returns the array node used for "_ttl"
* Returns the array node used for "_ttl".
*/
protected function getTtlNode()
{
Expand Down Expand Up @@ -491,9 +491,9 @@ protected function getPersistenceNode()

$node
->validate()
->ifTrue(function($v) { return isset($v['driver']) && 'propel' === $v['driver'] && isset($v['listener']); })
->ifTrue(function ($v) { return isset($v['driver']) && 'propel' === $v['driver'] && isset($v['listener']); })
->thenInvalid('Propel doesn\'t support listeners')
->ifTrue(function($v) { return isset($v['driver']) && 'propel' === $v['driver'] && isset($v['repository']); })
->ifTrue(function ($v) { return isset($v['driver']) && 'propel' === $v['driver'] && isset($v['repository']); })
->thenInvalid('Propel doesn\'t support the "repository" parameter')
->end()
->children()
Expand Down
Loading

0 comments on commit 345b5d4

Please sign in to comment.