-
Notifications
You must be signed in to change notification settings - Fork 736
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deprecate unsuffixed processor classes
- Loading branch information
Showing
15 changed files
with
396 additions
and
325 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,46 +2,16 @@ | |
|
||
namespace Elastica\Processor; | ||
|
||
trigger_deprecation('ruflin/elastica', '7.1.0', 'The "%s" class is deprecated, use "%s" instead. It will be removed in 8.0.', Append::class, AppendProcessor::class); | ||
|
||
/** | ||
* Elastica Append Processor. | ||
* | ||
* @author Federico Panini <[email protected]> | ||
* | ||
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/append-processor.html | ||
* @deprecated since version 7.1.0, use the AppendProcessor class instead. | ||
*/ | ||
class Append extends AbstractProcessor | ||
class Append extends AppendProcessor | ||
{ | ||
/** | ||
* Append constructor. | ||
* | ||
* @param string $field field name | ||
* @param array|string $value field values to append | ||
*/ | ||
public function __construct(string $field, $value) | ||
{ | ||
$this->setField($field); | ||
$this->setValue($value); | ||
} | ||
|
||
/** | ||
* Set field. | ||
* | ||
* @return $this | ||
*/ | ||
public function setField(string $field): self | ||
{ | ||
return $this->setParam('field', $field); | ||
} | ||
|
||
/** | ||
* Set field value. | ||
* | ||
* @param array|string $value | ||
* | ||
* @return $this | ||
*/ | ||
public function setValue($value): self | ||
{ | ||
return $this->setParam('value', $value); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
|
||
namespace Elastica\Processor; | ||
|
||
/** | ||
* Elastica Append Processor. | ||
* | ||
* @author Federico Panini <[email protected]> | ||
* | ||
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/append-processor.html | ||
*/ | ||
class AppendProcessor extends AbstractProcessor | ||
{ | ||
/** | ||
* @param string $field field name | ||
* @param array|string $value field values to append | ||
*/ | ||
public function __construct(string $field, $value) | ||
{ | ||
$this->setField($field); | ||
$this->setValue($value); | ||
} | ||
|
||
/** | ||
* Set field. | ||
* | ||
* @return $this | ||
*/ | ||
public function setField(string $field): self | ||
{ | ||
return $this->setParam('field', $field); | ||
} | ||
|
||
/** | ||
* Set field value. | ||
* | ||
* @param array|string $value | ||
* | ||
* @return $this | ||
*/ | ||
public function setValue($value): self | ||
{ | ||
return $this->setParam('value', $value); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,74 +2,16 @@ | |
|
||
namespace Elastica\Processor; | ||
|
||
trigger_deprecation('ruflin/elastica', '7.1.0', 'The "%s" class is deprecated, use "%s" instead. It will be removed in 8.0.', Attachment::class, AttachmentProcessor::class); | ||
|
||
/** | ||
* Elastica Attachment Processor. | ||
* | ||
* @author Federico Panini <[email protected]> | ||
* | ||
* @see https://www.elastic.co/guide/en/elasticsearch/plugins/current/ingest-attachment.html | ||
* @deprecated since version 7.1.0, use the AttachmentProcessor class instead. | ||
*/ | ||
class Attachment extends AbstractProcessor | ||
class Attachment extends AttachmentProcessor | ||
{ | ||
public const DEFAULT_TARGET_FIELD_VALUE = 'attachment'; | ||
public const DEFAULT_INDEXED_CHARS_VALUE = 100000; | ||
public const DEFAULT_IGNORE_MISSING_VALUE = false; | ||
|
||
/** | ||
* Attachment constructor. | ||
*/ | ||
public function __construct(string $field) | ||
{ | ||
$this->setField($field); | ||
} | ||
|
||
/** | ||
* Set field. | ||
* | ||
* @return $this | ||
*/ | ||
public function setField(string $field): self | ||
{ | ||
return $this->setParam('field', $field); | ||
} | ||
|
||
/** | ||
* Set target_field. Default attachment. | ||
* | ||
* @return $this | ||
*/ | ||
public function setTargetField(string $targetField): self | ||
{ | ||
return $this->setParam('target_field', $targetField); | ||
} | ||
|
||
/** | ||
* Set indexed_chars. Default 100000. | ||
* | ||
* @return $this | ||
*/ | ||
public function setIndexedChars(int $indexedChars): self | ||
{ | ||
return $this->setParam('indexed_chars', $indexedChars); | ||
} | ||
|
||
/** | ||
* Set properties. Default all properties. Can be content, title, name, author, keywords, date, content_type, content_length, language. | ||
* | ||
* @return $this | ||
*/ | ||
public function setProperties(array $properties): self | ||
{ | ||
return $this->setParam('properties', $properties); | ||
} | ||
|
||
/** | ||
* Set ignore_missing. Default value false. | ||
* | ||
* @return $this | ||
*/ | ||
public function setIgnoreMissing(bool $ignoreMissing): self | ||
{ | ||
return $this->setParam('ignore_missing', $ignoreMissing); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
<?php | ||
|
||
namespace Elastica\Processor; | ||
|
||
/** | ||
* Elastica Attachment Processor. | ||
* | ||
* @author Federico Panini <[email protected]> | ||
* | ||
* @see https://www.elastic.co/guide/en/elasticsearch/plugins/current/ingest-attachment.html | ||
*/ | ||
class AttachmentProcessor extends AbstractProcessor | ||
{ | ||
public const DEFAULT_TARGET_FIELD_VALUE = 'attachment'; | ||
public const DEFAULT_INDEXED_CHARS_VALUE = 100000; | ||
public const DEFAULT_IGNORE_MISSING_VALUE = false; | ||
|
||
public function __construct(string $field) | ||
{ | ||
$this->setField($field); | ||
} | ||
|
||
/** | ||
* Set field. | ||
* | ||
* @return $this | ||
*/ | ||
public function setField(string $field): self | ||
{ | ||
return $this->setParam('field', $field); | ||
} | ||
|
||
/** | ||
* Set target_field. Default attachment. | ||
* | ||
* @return $this | ||
*/ | ||
public function setTargetField(string $targetField): self | ||
{ | ||
return $this->setParam('target_field', $targetField); | ||
} | ||
|
||
/** | ||
* Set indexed_chars. Default 100000. | ||
* | ||
* @return $this | ||
*/ | ||
public function setIndexedChars(int $indexedChars): self | ||
{ | ||
return $this->setParam('indexed_chars', $indexedChars); | ||
} | ||
|
||
/** | ||
* Set properties. Default all properties. Can be content, title, name, author, keywords, date, content_type, content_length, language. | ||
* | ||
* @return $this | ||
*/ | ||
public function setProperties(array $properties): self | ||
{ | ||
return $this->setParam('properties', $properties); | ||
} | ||
|
||
/** | ||
* Set ignore_missing. Default value false. | ||
* | ||
* @return $this | ||
*/ | ||
public function setIgnoreMissing(bool $ignoreMissing): self | ||
{ | ||
return $this->setParam('ignore_missing', $ignoreMissing); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,66 +2,16 @@ | |
|
||
namespace Elastica\Processor; | ||
|
||
trigger_deprecation('ruflin/elastica', '7.1.0', 'The "%s" class is deprecated, use "%s" instead. It will be removed in 8.0.', Convert::class, ConvertProcessor::class); | ||
|
||
/** | ||
* Elastica Convert Processor. | ||
* | ||
* @author Federico Panini <[email protected]> | ||
* | ||
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/convert-processor.html | ||
* @deprecated since version 7.1.0, use the ConvertProcessor class instead. | ||
*/ | ||
class Convert extends AbstractProcessor | ||
class Convert extends ConvertProcessor | ||
{ | ||
public const DEFAULT_TARGET_FIELD_VALUE = 'field'; | ||
public const DEFAULT_IGNORE_MISSING_VALUE = false; | ||
|
||
/** | ||
* Convert constructor. | ||
*/ | ||
public function __construct(string $field, string $type) | ||
{ | ||
$this->setField($field); | ||
$this->setType($type); | ||
} | ||
|
||
/** | ||
* Set field. | ||
* | ||
* @return $this | ||
*/ | ||
public function setField(string $field): self | ||
{ | ||
return $this->setParam('field', $field); | ||
} | ||
|
||
/** | ||
* Set field value. | ||
* | ||
* @return $this | ||
*/ | ||
public function setType(string $type): self | ||
{ | ||
return $this->setParam('type', $type); | ||
} | ||
|
||
/** | ||
* Set target_field. Default value field. | ||
* | ||
* @return $this | ||
*/ | ||
public function setTargetField(string $targetField): self | ||
{ | ||
return $this->setParam('target_field', $targetField); | ||
} | ||
|
||
/** | ||
* Set ignore_missing. Default value false. | ||
* | ||
* @param bool $ignoreMissing only these values are allowed (integer|float|string|boolean|auto) | ||
* | ||
* @return $this | ||
*/ | ||
public function setIgnoreMissing(bool $ignoreMissing): self | ||
{ | ||
return $this->setParam('ignore_missing', $ignoreMissing); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<?php | ||
|
||
namespace Elastica\Processor; | ||
|
||
/** | ||
* Elastica Convert Processor. | ||
* | ||
* @author Federico Panini <[email protected]> | ||
* | ||
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/convert-processor.html | ||
*/ | ||
class ConvertProcessor extends AbstractProcessor | ||
{ | ||
public const DEFAULT_TARGET_FIELD_VALUE = 'field'; | ||
public const DEFAULT_IGNORE_MISSING_VALUE = false; | ||
|
||
public function __construct(string $field, string $type) | ||
{ | ||
$this->setField($field); | ||
$this->setType($type); | ||
} | ||
|
||
/** | ||
* Set field. | ||
* | ||
* @return $this | ||
*/ | ||
public function setField(string $field): self | ||
{ | ||
return $this->setParam('field', $field); | ||
} | ||
|
||
/** | ||
* Set field value. | ||
* | ||
* @return $this | ||
*/ | ||
public function setType(string $type): self | ||
{ | ||
return $this->setParam('type', $type); | ||
} | ||
|
||
/** | ||
* Set target_field. Default value field. | ||
* | ||
* @return $this | ||
*/ | ||
public function setTargetField(string $targetField): self | ||
{ | ||
return $this->setParam('target_field', $targetField); | ||
} | ||
|
||
/** | ||
* Set ignore_missing. Default value false. | ||
* | ||
* @param bool $ignoreMissing only these values are allowed (integer|float|string|boolean|auto) | ||
* | ||
* @return $this | ||
*/ | ||
public function setIgnoreMissing(bool $ignoreMissing): self | ||
{ | ||
return $this->setParam('ignore_missing', $ignoreMissing); | ||
} | ||
} |
Oops, something went wrong.