Skip to content

Commit

Permalink
[TASK] Reformat code to PSR-2 + normalize file header comment
Browse files Browse the repository at this point in the history
  • Loading branch information
dfeyer committed Nov 17, 2015
1 parent f645237 commit 3d8a299
Show file tree
Hide file tree
Showing 47 changed files with 3,214 additions and 3,093 deletions.
6 changes: 6 additions & 0 deletions .styleci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
preset: psr2

finder:
path:
- "Classes"
- "Tests"
47 changes: 23 additions & 24 deletions Classes/Flowpack/ElasticSearch/Annotations/Indexable.php
Original file line number Diff line number Diff line change
@@ -1,36 +1,35 @@
<?php
namespace Flowpack\ElasticSearch\Annotations;

/* *
* This script belongs to the TYPO3 Flow package "Flowpack.ElasticSearch".*
* *
* It is free software; you can redistribute it and/or modify it under *
* the terms of the GNU Lesser General Public License, either version 3 *
* of the License, or (at your option) any later version. *
* *
* The TYPO3 project - inspiring people to share! *
* */
/*
* This file is part of the Flowpack.ElasticSearch package.
*
* (c) Contributors of the Flowpack Team - flowpack.org
*
* This package is Open Source Software. For the full copyright and license
* information, please view the LICENSE file which was distributed with this
* source code.
*/

use Doctrine\Common\Annotations\Annotation as DoctrineAnnotation;

/**
* @Annotation
* @DoctrineAnnotation\Target({"CLASS", "PROPERTY"})
*/
final class Indexable {

/**
* The name of the index this object has to be stored to, if target is CLASS
*
* @var string
*/
public $indexName;
final class Indexable
{
/**
* The name of the index this object has to be stored to, if target is CLASS
*
* @var string
*/
public $indexName;

/**
* The type this object has to be stored as, if target is CLASS
*
* @var string
*/
public $typeName;
/**
* The type this object has to be stored as, if target is CLASS
*
* @var string
*/
public $typeName;
}

194 changes: 98 additions & 96 deletions Classes/Flowpack/ElasticSearch/Annotations/Mapping.php
Original file line number Diff line number Diff line change
@@ -1,116 +1,118 @@
<?php
namespace Flowpack\ElasticSearch\Annotations;

/* *
* This script belongs to the TYPO3 Flow package "Flowpack.ElasticSearch".*
* *
* It is free software; you can redistribute it and/or modify it under *
* the terms of the GNU Lesser General Public License, either version 3 *
* of the License, or (at your option) any later version. *
* *
* The TYPO3 project - inspiring people to share! *
* */
/*
* This file is part of the Flowpack.ElasticSearch package.
*
* (c) Contributors of the Flowpack Team - flowpack.org
*
* This package is Open Source Software. For the full copyright and license
* information, please view the LICENSE file which was distributed with this
* source code.
*/

use Doctrine\Common\Annotations\Annotation as DoctrineAnnotation;

/**
* @Annotation
* @DoctrineAnnotation\Target("PROPERTY")
*/
final class Mapping {

/**
* The name of the field that will be stored in the index.
* Defaults to the property/field name.
*
* @var string
* @see http://www.elasticsearch.org/guide/reference/mapping/core-types.html
*/
public $index_name;
final class Mapping
{
/**
* The name of the field that will be stored in the index.
* Defaults to the property/field name.
*
* @var string
* @see http://www.elasticsearch.org/guide/reference/mapping/core-types.html
*/
public $index_name;

/**
* Set to yes the store actual field in the index, no to not store it.
* Defaults to `no` (note, the JSON document itself is stored, and it can be retrieved from it).
*
* @var string
* @see http://www.elasticsearch.org/guide/reference/mapping/core-types.html
*/
public $store;
/**
* Set to yes the store actual field in the index, no to not store it.
* Defaults to `no` (note, the JSON document itself is stored, and it can be retrieved from it).
*
* @var string
* @see http://www.elasticsearch.org/guide/reference/mapping/core-types.html
*/
public $store;

/**
* Set to analyzed for the field to be indexed and searchable after being broken down into token using an analyzer.
* not_analyzed means that its still searchable, but does not go through any analysis process or broken down into tokens.
* no means that it won’t be searchable at all (as an individual field; it may still be included in _all).
* Defaults to analyzed.
*
* @var string
* @see http://www.elasticsearch.org/guide/reference/mapping/core-types.html
*/
public $index;
/**
* Set to analyzed for the field to be indexed and searchable after being broken down into token using an analyzer.
* not_analyzed means that its still searchable, but does not go through any analysis process or broken down into tokens.
* no means that it won’t be searchable at all (as an individual field; it may still be included in _all).
* Defaults to analyzed.
*
* @var string
* @see http://www.elasticsearch.org/guide/reference/mapping/core-types.html
*/
public $index;

/**
* Possible values are `no`, `yes`, `with_offsets`, `with_positions`, `with_positions_offsets`.
* Defaults to `no`.
*
* @see http://www.elasticsearch.org/guide/reference/mapping/core-types.html
* @var string
*/
public $term_vector;
/**
* Possible values are `no`, `yes`, `with_offsets`, `with_positions`, `with_positions_offsets`.
* Defaults to `no`.
*
* @see http://www.elasticsearch.org/guide/reference/mapping/core-types.html
* @var string
*/
public $term_vector;

/**
* The boost value. Defaults to `1.0`.
*
* @var float
* @see http://www.elasticsearch.org/guide/reference/mapping/boost-field.html
*/
public $boost;
/**
* The boost value. Defaults to `1.0`.
*
* @var float
* @see http://www.elasticsearch.org/guide/reference/mapping/boost-field.html
*/
public $boost;

/**
* The analyzer used to analyze the text contents when analyzed during indexing and when searching using a query string.
* Defaults to the globally configured analyzer.
*
* @var string
* @see http://www.elasticsearch.org/guide/reference/mapping/core-types.html
*/
public $analyzer;
/**
* The analyzer used to analyze the text contents when analyzed during indexing and when searching using a query string.
* Defaults to the globally configured analyzer.
*
* @var string
* @see http://www.elasticsearch.org/guide/reference/mapping/core-types.html
*/
public $analyzer;

/**
* The type to use for this
* Defaults to the property/field type.
*
* @var string
* @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-types.html
*/
public $type;
/**
* The type to use for this
* Defaults to the property/field type.
*
* @var string
* @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-types.html
*/
public $type;

/**
* The date format.
* Defaults to `dateOptionalTime`.
*
* @var string
* @see http://www.elasticsearch.org/guide/reference/mapping/date-format.html
*/
public $format;
/**
* The date format.
* Defaults to `dateOptionalTime`.
*
* @var string
* @see http://www.elasticsearch.org/guide/reference/mapping/date-format.html
*/
public $format;

/**
* @var array
* @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/_multi_fields.html
*/
public $fields;
/**
* @var array
* @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/_multi_fields.html
*/
public $fields;

/**
* Returns this class's properties as type/value array in order to directly use it for mapping information
*/
public function getPropertiesArray() {
$properties = get_object_vars($this);
unset($properties['fields']);
return $properties;
}
/**
* Returns this class's properties as type/value array in order to directly use it for mapping information
*/
public function getPropertiesArray()
{
$properties = get_object_vars($this);
unset($properties['fields']);
return $properties;
}

/**
* @return array
*/
public function getFields() {
return $this->fields;
}
}
/**
* @return array
*/
public function getFields()
{
return $this->fields;
}
}
39 changes: 19 additions & 20 deletions Classes/Flowpack/ElasticSearch/Annotations/Transform.php
Original file line number Diff line number Diff line change
@@ -1,32 +1,31 @@
<?php
namespace Flowpack\ElasticSearch\Annotations;

/* *
* This script belongs to the TYPO3 Flow package "Flowpack.ElasticSearch".*
* *
* It is free software; you can redistribute it and/or modify it under *
* the terms of the GNU Lesser General Public License, either version 3 *
* of the License, or (at your option) any later version. *
* *
* The TYPO3 project - inspiring people to share! *
* */
/*
* This file is part of the Flowpack.ElasticSearch package.
*
* (c) Contributors of the Flowpack Team - flowpack.org
*
* This package is Open Source Software. For the full copyright and license
* information, please view the LICENSE file which was distributed with this
* source code.
*/

use Doctrine\Common\Annotations\Annotation as DoctrineAnnotation;

/**
* @Annotation
* @DoctrineAnnotation\Target("PROPERTY")
*/
final class Transform {

/**
* @var string
*/
public $type;
final class Transform
{
/**
* @var string
*/
public $type;

/**
* @var array
*/
public $options;
/**
* @var array
*/
public $options;
}

Loading

0 comments on commit 3d8a299

Please sign in to comment.