Skip to content

Commit

Permalink
Apply linting php-cs-fixer command to cleanup files
Browse files Browse the repository at this point in the history
  • Loading branch information
ruflin committed May 29, 2015
1 parent 5909cbb commit 7a35358
Show file tree
Hide file tree
Showing 380 changed files with 4,373 additions and 3,705 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ All notable changes to this project will be documented in this file based on the
- Guzzle Http dependency updated to 5.3.*
- Remove NO_DEV builds from travis build matrix to speed up building. All builds include no dev packages.
- Introduction of benchmark test group to make it easy to run benchmark tests.
- Make the docker images directly [available](https://hub.docker.com/u/ruflin/) on the docker registry. This speeds up fetching of the images and automates the build of the images.

### Backward Compatibility Breaks
- `Elastica\ScanAndScroll::$_lastScrollId` removed: `key()` now always returns the next scroll id [#842](https://github.com/ruflin/Elastica/issues/842/)
Expand Down
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
elastica:
build: .
#build: . # In case the image must be built locally
image: ruflin/elastica
ports:
- "9200:9200"
volumes:
Expand Down
101 changes: 61 additions & 40 deletions lib/Elastica/AbstractUpdateAction.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
<?php

namespace Elastica;

/**
* Base class for things that can be sent to the update api (Document and
* Script).
*
* @category Xodoa
* @package Elastica
*
* @author Nik Everett <[email protected]>
*/
class AbstractUpdateAction extends Param
Expand All @@ -20,7 +19,8 @@ class AbstractUpdateAction extends Param
/**
* Sets the id of the document.
*
* @param string $id
* @param string $id
*
* @return $this
*/
public function setId($id)
Expand All @@ -29,7 +29,7 @@ public function setId($id)
}

/**
* Returns document id
* Returns document id.
*
* @return string|int Document id
*/
Expand All @@ -47,9 +47,10 @@ public function hasId()
}

/**
* Sets lifetime of document
* Sets lifetime of document.
*
* @param string $ttl
*
* @param string $ttl
* @return $this
*/
public function setTtl($ttl)
Expand All @@ -74,9 +75,10 @@ public function hasTtl()
}

/**
* Sets the document type name
* Sets the document type name.
*
* @param string $type Type name
*
* @param string $type Type name
* @return $this
*/
public function setType($type)
Expand All @@ -90,7 +92,7 @@ public function setType($type)
}

/**
* Return document type name
* Return document type name.
*
* @throws \Elastica\Exception\InvalidException
*
Expand All @@ -102,9 +104,10 @@ public function getType()
}

/**
* Sets the document index name
* Sets the document index name.
*
* @param string $index Index name
*
* @param string $index Index name
* @return $this
*/
public function setIndex($index)
Expand All @@ -117,7 +120,7 @@ public function setIndex($index)
}

/**
* Get the document index name
* Get the document index name.
*
* @throws \Elastica\Exception\InvalidException
*
Expand All @@ -129,10 +132,12 @@ public function getIndex()
}

/**
* Sets the version of a document for use with optimistic concurrency control
* Sets the version of a document for use with optimistic concurrency control.
*
* @param int $version Document version
*
* @param int $version Document version
* @return $this
*
* @link https://www.elastic.co/blog/versioning
*/
public function setVersion($version)
Expand All @@ -141,7 +146,7 @@ public function setVersion($version)
}

/**
* Returns document version
* Returns document version.
*
* @return string|int Document version
*/
Expand All @@ -160,9 +165,10 @@ public function hasVersion()

/**
* Sets the version_type of a document
* Default in ES is internal, but you can set to external to use custom versioning
* Default in ES is internal, but you can set to external to use custom versioning.
*
* @param int $versionType Document version type
*
* @param int $versionType Document version type
* @return $this
*/
public function setVersionType($versionType)
Expand All @@ -171,7 +177,7 @@ public function setVersionType($versionType)
}

/**
* Returns document version type
* Returns document version type.
*
* @return string|int Document version type
*/
Expand All @@ -189,10 +195,12 @@ public function hasVersionType()
}

/**
* Sets parent document id
* Sets parent document id.
*
* @param string|int $parent Parent document id
*
* @param string|int $parent Parent document id
* @return $this
*
* @link http://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-parent-field.html
*/
public function setParent($parent)
Expand All @@ -201,7 +209,7 @@ public function setParent($parent)
}

/**
* Returns the parent document id
* Returns the parent document id.
*
* @return string|int Parent document id
*/
Expand All @@ -219,9 +227,10 @@ public function hasParent()
}

/**
* Set operation type
* Set operation type.
*
* @param string $opType Only accept create
*
* @param string $opType Only accept create
* @return $this
*/
public function setOpType($opType)
Expand All @@ -230,7 +239,8 @@ public function setOpType($opType)
}

/**
* Get operation type
* Get operation type.
*
* @return string
*/
public function getOpType()
Expand All @@ -247,9 +257,10 @@ public function hasOpType()
}

/**
* Set percolate query param
* Set percolate query param.
*
* @param string $value percolator filter
*
* @param string $value percolator filter
* @return $this
*/
public function setPercolate($value = '*')
Expand All @@ -258,7 +269,7 @@ public function setPercolate($value = '*')
}

/**
* Get percolate parameter
* Get percolate parameter.
*
* @return string
*/
Expand All @@ -276,9 +287,10 @@ public function hasPercolate()
}

/**
* Set routing query param
* Set routing query param.
*
* @param string $value routing
*
* @param string $value routing
* @return $this
*/
public function setRouting($value)
Expand All @@ -287,7 +299,7 @@ public function setRouting($value)
}

/**
* Get routing parameter
* Get routing parameter.
*
* @return string
*/
Expand All @@ -305,7 +317,8 @@ public function hasRouting()
}

/**
* @param array|string $fields
* @param array|string $fields
*
* @return $this
*/
public function setFields($fields)
Expand Down Expand Up @@ -342,7 +355,8 @@ public function hasFields()
}

/**
* @param int $num
* @param int $num
*
* @return $this
*/
public function setRetryOnConflict($num)
Expand All @@ -367,7 +381,8 @@ public function hasRetryOnConflict()
}

/**
* @param string $timestamp
* @param string $timestamp
*
* @return $this
*/
public function setTimestamp($timestamp)
Expand All @@ -392,7 +407,8 @@ public function hasTimestamp()
}

/**
* @param bool $refresh
* @param bool $refresh
*
* @return $this
*/
public function setRefresh($refresh = true)
Expand All @@ -417,7 +433,8 @@ public function hasRefresh()
}

/**
* @param string $timeout
* @param string $timeout
*
* @return $this
*/
public function setTimeout($timeout)
Expand All @@ -442,7 +459,8 @@ public function hasTimeout()
}

/**
* @param string $timeout
* @param string $timeout
*
* @return $this
*/
public function setConsistency($timeout)
Expand All @@ -467,7 +485,8 @@ public function hasConsistency()
}

/**
* @param string $timeout
* @param string $timeout
*
* @return $this
*/
public function setReplication($timeout)
Expand All @@ -492,7 +511,8 @@ public function hasReplication()
}

/**
* @param \Elastica\Document|array $data
* @param \Elastica\Document|array $data
*
* @return $this
*/
public function setUpsert($data)
Expand Down Expand Up @@ -520,8 +540,9 @@ public function hasUpsert()
}

/**
* @param array $fields if empty array all options will be returned, field names can be either with underscored either without, i.e. _percolate, routing
* @param bool $withUnderscore should option keys contain underscore prefix
* @param array $fields if empty array all options will be returned, field names can be either with underscored either without, i.e. _percolate, routing
* @param bool $withUnderscore should option keys contain underscore prefix
*
* @return array
*/
public function getOptions(array $fields = array(), $withUnderscore = false)
Expand Down
17 changes: 11 additions & 6 deletions lib/Elastica/Aggregation/AbstractAggregation.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

namespace Elastica\Aggregation;

use Elastica\Exception\InvalidException;
Expand All @@ -26,8 +25,10 @@ public function __construct($name)
}

/**
* Set the name of this aggregation
* Set the name of this aggregation.
*
* @param string $name
*
* @return $this
*/
public function setName($name)
Expand All @@ -38,7 +39,8 @@ public function setName($name)
}

/**
* Retrieve the name of this aggregation
* Retrieve the name of this aggregation.
*
* @return string
*/
public function getName()
Expand All @@ -47,7 +49,8 @@ public function getName()
}

/**
* Retrieve all subaggregations belonging to this aggregation
* Retrieve all subaggregations belonging to this aggregation.
*
* @return array
*/
public function getAggs()
Expand All @@ -56,10 +59,12 @@ public function getAggs()
}

/**
* Add a sub-aggregation
* Add a sub-aggregation.
*
* @throws \Elastica\Exception\InvalidException
*
* @param AbstractAggregation $aggregation
* @param AbstractAggregation $aggregation
*
* @return $this
*/
public function addAggregation(AbstractAggregation $aggregation)
Expand Down
Loading

0 comments on commit 7a35358

Please sign in to comment.