Skip to content

Commit

Permalink
Version 1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
mekras committed Mar 12, 2017
1 parent bc57bf1 commit 9d6b730
Show file tree
Hide file tree
Showing 18 changed files with 59 additions and 57 deletions.
9 changes: 6 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
# Changelog

## Unreleased
## 1.6 - 2017-03-12

### Added

- Aspell — aspell backend.
- Ispell — ispell backend.
- IconvSource — converts text encoding using iconv.
- MetaSource — base class for meta sources.
- EncodingAwareSource — text source with specified encoding.
- ExternalSpeller — base class for external program adapters.
- Own exceptions.

### Changed

- StringSource, FileSource, HtmlSource and XliffSource now implements EncodingAwareSource.
- HtmlSource and XliffSource now derived from MetaSource.
- Hunspell class derived from new Ispell class.
- All sources now implement EncodingAwareSource.
- HtmlSource and XliffSource derived from MetaSource.

## 1.5.1 - 2017-03-11

Expand Down
8 changes: 4 additions & 4 deletions src/Aspell/Aspell.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
/**
* Aspell adapter.
*
* @since x.x
* @since 1.6
*/
class Aspell extends Ispell
{
Expand All @@ -36,7 +36,7 @@ class Aspell extends Ispell
*
* @param string $binaryPath Path to aspell binary (default "aspell").
*
* @since x.x
* @since 1.6
*/
public function __construct($binaryPath = 'aspell')
{
Expand All @@ -53,7 +53,7 @@ public function __construct($binaryPath = 'aspell')
* @throws LogicException
* @throws RuntimeException
*
* @since x.x
* @since 1.6
*/
public function getSupportedLanguages()
{
Expand Down Expand Up @@ -101,7 +101,7 @@ public function getSupportedLanguages()
* @throws LogicException
* @throws RuntimeException
*
* @since x.x
* @since 1.6
*/
protected function createArguments(Source $source, array $languages)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Exception/EnvironmentException.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
/**
* Environment misconfiguration.
*
* @since x.x
* @since 1.6
*/
class EnvironmentException extends RuntimeException
{
Expand Down
4 changes: 2 additions & 2 deletions src/Exception/ExternalProgramFailedException.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
/**
* External program execution failed.
*
* @since x.x
* @since 1.6
*/
class ExternalProgramFailedException extends RuntimeException
{
Expand All @@ -24,7 +24,7 @@ class ExternalProgramFailedException extends RuntimeException
* @param int $code Exit code
* @param \Exception|null $previous Previous exception if any.
*
* @since x.x
* @since 1.6
*/
public function __construct($command, $message = '', $code = 0, \Exception $previous = null)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Exception/PhpSpellerException.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
/**
* Common interface for all Speller exceptions.
*
* @since x.x
* @since 1.6
*/
interface PhpSpellerException
{
Expand Down
2 changes: 1 addition & 1 deletion src/Exception/RuntimeException.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
/**
* Runtime exception.
*
* @since x.x
* @since 1.6
*/
class RuntimeException extends \RuntimeException implements PhpSpellerException
{
Expand Down
2 changes: 1 addition & 1 deletion src/Exception/SourceException.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
/**
* Fail to read from text source.
*
* @since x.x
* @since 1.6
*/
class SourceException extends RuntimeException
{
Expand Down
20 changes: 10 additions & 10 deletions src/ExternalSpeller.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
/**
* Base class for external program adapters.
*
* @since x.x
* @since 1.6
*/
abstract class ExternalSpeller implements Speller
{
Expand All @@ -43,7 +43,7 @@ abstract class ExternalSpeller implements Speller
*
* @param string $binaryPath Command to run external speller.
*
* @since x.x
* @since 1.6
*/
public function __construct($binaryPath)
{
Expand All @@ -66,7 +66,7 @@ public function __construct($binaryPath)
* @throws \Symfony\Component\Process\Exception\LogicException
*
* @see http://tools.ietf.org/html/bcp47
* @since x.x
* @since 1.6
*/
public function checkText(Source $source, array $languages)
{
Expand Down Expand Up @@ -117,7 +117,7 @@ public function checkText(Source $source, array $languages)
* @param int|float|null $seconds Timeout in seconds.
*
* @see \Symfony\Component\Process\Process::setTimeout()
* @since x.x
* @since 1.6
*/
public function setTimeout($seconds)
{
Expand All @@ -132,7 +132,7 @@ public function setTimeout($seconds)
*
* @return string
*
* @since x.x
* @since 1.6
*/
protected function composeCommand($args)
{
Expand All @@ -150,7 +150,7 @@ protected function composeCommand($args)
*
* @return string
*
* @since x.x
* @since 1.6
*/
protected function getBinary()
{
Expand All @@ -165,7 +165,7 @@ protected function getBinary()
*
* @return string[]
*
* @since x.x
* @since 1.6
*
* @SuppressWarnings(PMD.UnusedFormalParameter)
*/
Expand All @@ -182,7 +182,7 @@ protected function createArguments(Source $source, array $languages)
*
* @return string[]
*
* @since x.x
* @since 1.6
*
* @SuppressWarnings(PMD.UnusedFormalParameter)
*/
Expand All @@ -198,7 +198,7 @@ protected function createEnvVars(Source $source, array $languages)
*
* @return Issue[]
*
* @since x.x
* @since 1.6
*/
abstract protected function parseOutput($output);

Expand All @@ -212,7 +212,7 @@ abstract protected function parseOutput($output);
* @throws ExternalProgramFailedException
* @throws InvalidArgumentException
*
* @since x.x
* @since 1.6
*/
protected function createProcess($args = null)
{
Expand Down
6 changes: 3 additions & 3 deletions src/Hunspell/Hunspell.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
/**
* Hunspell adapter.
*
* @since x.x Derived from {@see Ispell}.
* @since 1.6 Derived from {@see Ispell}.
* @since 1.0
*/
class Hunspell extends Ispell
Expand Down Expand Up @@ -153,7 +153,7 @@ public function setCustomDictionaries(array $customDictionaries)
* @throws LogicException
* @throws RuntimeException
*
* @since x.x
* @since 1.6
*/
protected function createArguments(Source $source, array $languages)
{
Expand Down Expand Up @@ -183,7 +183,7 @@ protected function createArguments(Source $source, array $languages)
*
* @return string[]
*
* @since x.x
* @since 1.6
*
* @SuppressWarnings(PMD.UnusedFormalParameter)
*/
Expand Down
14 changes: 7 additions & 7 deletions src/Ispell/Ispell.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* 1. since ispell allow to use only one dictionary at once, only first item taken from $languages
* argument in {@see checkText()}.
*
* @since x.x
* @since 1.6
*/
class Ispell extends ExternalSpeller
{
Expand Down Expand Up @@ -57,7 +57,7 @@ class Ispell extends ExternalSpeller
* @param string $binaryPath Command to run ispell (default "ispell").
* @param string|null $dictFolder Folder with bundled ispell dictionaries (null — autodetect).
*
* @since x.x
* @since 1.6
*/
public function __construct($binaryPath = 'ispell', $dictFolder = null)
{
Expand All @@ -74,7 +74,7 @@ public function __construct($binaryPath = 'ispell', $dictFolder = null)
* @throws LogicException
* @throws RuntimeException
*
* @since x.x
* @since 1.6
*/
public function getSupportedLanguages()
{
Expand All @@ -97,7 +97,7 @@ public function getSupportedLanguages()
*
* @param LanguageMapper $mapper
*
* @since x.x
* @since 1.6
*/
public function setLanguageMapper(LanguageMapper $mapper)
{
Expand All @@ -109,7 +109,7 @@ public function setLanguageMapper(LanguageMapper $mapper)
*
* @return LanguageMapper
*
* @since x.x
* @since 1.6
*/
protected function getLanguageMapper()
{
Expand All @@ -132,7 +132,7 @@ protected function getLanguageMapper()
* @throws LogicException
* @throws RuntimeException
*
* @since x.x
* @since 1.6
*
* @SuppressWarnings(PMD.UnusedFormalParameter)
*/
Expand Down Expand Up @@ -161,7 +161,7 @@ protected function createArguments(Source $source, array $languages)
*
* @return Issue[]
*
* @since x.x
* @since 1.6
*/
protected function parseOutput($output)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Source/EncodingAwareSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
/**
* Text source interface.
*
* @since x.x
* @since 1.6
*
* @todo Merge with Source in version 2.0.
* @todo Remove in version 3.0.
Expand All @@ -24,7 +24,7 @@ interface EncodingAwareSource extends Source
*
* @return string
*
* @since x.x
* @since 1.6
*/
public function getEncoding();
}
8 changes: 4 additions & 4 deletions src/Source/FileSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/**
* File as text source.
*
* @since x.x Implements EncodingAwareSource.
* @since 1.6 Implements EncodingAwareSource.
* @since 1.2
*/
class FileSource implements EncodingAwareSource
Expand All @@ -40,7 +40,7 @@ class FileSource implements EncodingAwareSource
* @param string $filename
* @param string $encoding File encoding (default to "UTF-8").
*
* @since x.x New argument — $encoding.
* @since 1.6 New argument — $encoding.
* @since 1.2
*/
public function __construct($filename, $encoding = 'UTF-8')
Expand All @@ -56,7 +56,7 @@ public function __construct($filename, $encoding = 'UTF-8')
*
* @throws SourceException Fail to read from text source.
*
* @since x.x Throws {@see SourceException}.
* @since 1.6 Throws {@see SourceException}.
* @since 1.2
*/
public function getAsString()
Expand All @@ -77,7 +77,7 @@ public function getAsString()
*
* @return string
*
* @since x.x
* @since 1.6
*/
public function getEncoding()
{
Expand Down
7 changes: 3 additions & 4 deletions src/Source/HtmlSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
/**
* HTML document as a text source.
*
* @since x.x derived from MetaSource.
* @since 1.6 derived from StringSource.
* @since 1.6 derived from MetaSource.
* @since 1.5
*/
class HtmlSource extends MetaSource
Expand All @@ -41,7 +40,7 @@ class HtmlSource extends MetaSource
*
* @throws \Mekras\Speller\Exception\SourceException
*
* @since x.x Accepts EncodingAwareSource
* @since 1.6 Accepts EncodingAwareSource
* @since 1.5
*
* @todo deprecate string $source in version 2.0
Expand Down Expand Up @@ -77,7 +76,7 @@ public function getAsString()
*
* @return string
*
* @since x.x
* @since 1.6
*/
public function getEncoding()
{
Expand Down
Loading

0 comments on commit 9d6b730

Please sign in to comment.