Skip to content

Commit

Permalink
Merge pull request piotrplenik#166 from peter-gribanov/js_to_php
Browse files Browse the repository at this point in the history
Rename function parseBetterJSAlternative()
  • Loading branch information
TomasVotruba authored Sep 12, 2019
2 parents c3ba178 + f9d66a2 commit e73bc83
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ testing.
**Bad:**

```php
function parseBetterJSAlternative(string $code): void
function parseBetterPHPAlternative(string $code): void
{
$regexes = [
// ...
Expand All @@ -656,7 +656,7 @@ function parseBetterJSAlternative(string $code): void

**Bad too:**

We have carried out some of the functionality, but the `parseBetterJSAlternative()` function is still very complex and not testable.
We have carried out some of the functionality, but the `parseBetterPHPAlternative()` function is still very complex and not testable.

```php
function tokenize(string $code): array
Expand Down Expand Up @@ -686,7 +686,7 @@ function lexer(array $tokens): array
return $ast;
}

function parseBetterJSAlternative(string $code): void
function parseBetterPHPAlternative(string $code): void
{
$tokens = tokenize($code);
$ast = lexer($tokens);
Expand All @@ -698,7 +698,7 @@ function parseBetterJSAlternative(string $code): void

**Good:**

The best solution is move out the dependencies of `parseBetterJSAlternative()` function.
The best solution is move out the dependencies of `parseBetterPHPAlternative()` function.

```php
class Tokenizer
Expand Down Expand Up @@ -734,7 +734,7 @@ class Lexer
}
}

class BetterJSAlternative
class BetterPHPAlternative
{
private $tokenizer;
private $lexer;
Expand Down

0 comments on commit e73bc83

Please sign in to comment.