Skip to content

BackCompat\Helper: add getEncoding()helper method#118

Merged
jrfnl merged 2 commits intodevelopfrom
feature/helper-new-getencoding-method
Mar 25, 2020
Merged

BackCompat\Helper: add getEncoding()helper method#118
jrfnl merged 2 commits intodevelopfrom
feature/helper-new-getencoding-method

Conversation

@jrfnl
Copy link
Copy Markdown
Member

@jrfnl jrfnl commented Mar 25, 2020

BackCompat\Helper: add getEncoding()helper method

... to retrieve the file encoding a project supposedly uses. No check is done to see if the encoding set is actually correct for the files presented to PHPCS.

In PHPCS, the encoding can be set via --config-set or --encoding from the command-line or via a custom ruleset like <arg name="encoding" value="utf-8"/>.

The default encoding encoding used by PHPCS changed between PHPCS 2.x (iso-8859-1) and 3.x utf-8.

Using the utf-8 file encoding is strongly advised for all PHP projects.

Includes minimal unit tests.

Orthography::isLastCharPunctuation(): implement use of the Helper::getEncoding() method

jrfnl added 2 commits March 25, 2020 19:53
... to retrieve the file encoding a project supposedly uses. No check is done to see if the `encoding` set is actually correct for the files presented to PHPCS.

In PHPCS, the `encoding` can be set via `--config-set` or `--encoding` from the command-line or via a custom ruleset like `<arg name="encoding" value="utf-8"/>`.

The default encoding encoding used by PHPCS changed between PHPCS 2.x (`iso-8859-1`) and 3.x `utf-8`.

Using the `utf-8` file encoding is strongly advised for all PHP projects.

Includes minimal unit tests.
@jrfnl jrfnl added this to the 1.0.0 milestone Mar 25, 2020
@jrfnl jrfnl merged commit 9676824 into develop Mar 25, 2020
@jrfnl jrfnl deleted the feature/helper-new-getencoding-method branch March 25, 2020 19:20
@jrfnl jrfnl modified the milestones: 1.0.0, 1.0.0-alpha3 May 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

1 participant