Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

Commit

Permalink
autofix all the lint errors, update hhast to not have false positives
Browse files Browse the repository at this point in the history
  • Loading branch information
fredemmott committed Aug 7, 2018
1 parent 72e4370 commit c3bc8cd
Show file tree
Hide file tree
Showing 38 changed files with 55 additions and 56 deletions.
10 changes: 5 additions & 5 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions examples/BaseRouterExample.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?hh
<?hh // strict
/*
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
Expand All @@ -16,8 +16,8 @@

require_once(__DIR__.'/../vendor/hh_autoload.php');

use Facebook\HackRouter\BaseRouter;
use Facebook\HackRouter\HttpMethod;
use type Facebook\HackRouter\BaseRouter;
use type Facebook\HackRouter\HttpMethod;

/** This can be whatever you want; in this case, it's a
* callable, but classname<MyWebControllerBase> is also a
Expand Down Expand Up @@ -67,4 +67,5 @@ function main(): void {
}
}

/* HH_IGNORE_ERROR[1002] top-level statement in strict file */
main();
6 changes: 3 additions & 3 deletions examples/UriPatternsExample.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?hh
<?hh // strict
/*
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
Expand All @@ -16,14 +16,13 @@

require_once(__DIR__.'/../vendor/hh_autoload.php');

use Facebook\HackRouter\{
use type Facebook\HackRouter\{
BaseRouter,
GetFastRoutePatternFromUriPattern,
GetUriBuilderFromUriPattern,
HasUriPattern,
HttpMethod,
RequestParameters,
UriBuilder,
UriPattern
};

Expand Down Expand Up @@ -124,4 +123,5 @@ function main(): void {
}
}

/* HH_IGNORE_ERROR[1002] top-level statement in strict file */
main();
2 changes: 1 addition & 1 deletion src/PatternParser/LiteralNode.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?hh //strict
<?hh // strict
/*
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion src/PatternParser/Node.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?hh //strict
<?hh // strict
/*
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion src/PatternParser/OptionalNode.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?hh //strict
<?hh // strict
/*
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
Expand Down
3 changes: 1 addition & 2 deletions src/PatternParser/ParameterNode.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?hh //strict
<?hh // strict
/*
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
Expand All @@ -10,7 +10,6 @@

namespace Facebook\HackRouter\PatternParser;

use namespace HH\Lib\Str;

final class ParameterNode implements Node {
public function __construct(private string $name, private ?string $regexp) {
Expand Down
2 changes: 1 addition & 1 deletion src/PatternParser/Parser.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?hh //strict
<?hh // strict
/*
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
Expand Down
4 changes: 2 additions & 2 deletions src/PatternParser/PatternNode.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?hh //strict
<?hh // strict
/*
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
Expand All @@ -10,7 +10,7 @@

namespace Facebook\HackRouter\PatternParser;

use namespace HH\Lib\{Keyset, Str, Vec};
use namespace HH\Lib\{Str, Vec};

final class PatternNode implements Node {
public function __construct(private vec<Node> $children) {
Expand Down
2 changes: 1 addition & 1 deletion src/PatternParser/Token.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?hh //strict
<?hh // strict
/*
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion src/PatternParser/TokenType.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?hh //strict
<?hh // strict
/*
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion src/PatternParser/tokenize.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?hh //strict
<?hh // strict
/*
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion src/request-parameters/EnumRequestParameter.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?hh //strict
<?hh // strict
/*
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion src/request-parameters/IntRequestParameter.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?hh //strict
<?hh // strict
/*
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion src/request-parameters/RequestParameter.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?hh //strict
<?hh // strict
/*
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion src/request-parameters/StringRequestParameter.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?hh //strict
<?hh // strict
/*
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion src/request-parameters/TypedRequestParameter.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?hh //strict
<?hh // strict
/*
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion src/request-parameters/TypedUriParameter.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?hh //strict
<?hh // strict
/*
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion src/request-parameters/UriParameter.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?hh //strict
<?hh // strict
/*
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion src/router/HttpMethod.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?hh //strict
<?hh // strict
/*
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion src/router/PrefixMatching/PrefixMap.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?hh //strict
<?hh // strict
/*
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
Expand Down
3 changes: 1 addition & 2 deletions src/router/PrefixMatching/PrefixMapOrResponder.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?hh //strict
<?hh // strict
/*
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
Expand All @@ -10,7 +10,6 @@

namespace Facebook\HackRouter\PrefixMatching;

use namespace Facebook\TypeAssert;

final class PrefixMapOrResponder<T> {
public function __construct(
Expand Down
2 changes: 1 addition & 1 deletion src/uri-patterns/GetFastRoutePatternFromUriPattern.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?hh //strict
<?hh // strict
/*
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion src/uri-patterns/GetUriBuilderFromUriPattern.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?hh //strict
<?hh // strict
/*
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion src/uri-patterns/HasFastRouteFragment.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?hh //strict
<?hh // strict
/*
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion src/uri-patterns/HasUriPattern.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?hh //strict
<?hh // strict
/*
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion src/uri-patterns/UriBuilder.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?hh //strict
<?hh // strict
/*
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion src/uri-patterns/UriBuilderBase.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?hh //strict
<?hh // strict
/*
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion src/uri-patterns/UriBuilderGetPath.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?hh //strict
<?hh // strict
/*
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion src/uri-patterns/UriBuilderSetters.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?hh //strict
<?hh // strict
/*
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion src/uri-patterns/UriBuilderWithPath.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?hh //strict
<?hh // strict
/*
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion src/uri-patterns/UriPattern.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?hh //strict
<?hh // strict
/*
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion src/uri-patterns/UriPatternLiteral.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?hh //strict
<?hh // strict
/*
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion src/uri-patterns/UriPatternPart.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?hh //strict
<?hh // strict
/*
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
Expand Down
4 changes: 2 additions & 2 deletions tests/RequestParametersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

namespace Facebook\HackRouter;

use \Facebook\HackRouter\Tests\TestIntEnum;
use \Facebook\HackRouter\Tests\TestStringEnum;
use type Facebook\HackRouter\Tests\TestIntEnum;
use type Facebook\HackRouter\Tests\TestStringEnum;

final class RequestParametersTest extends \PHPUnit_Framework_TestCase {
public function testStringParam(): void {
Expand Down
10 changes: 5 additions & 5 deletions tests/RouterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@

namespace Facebook\HackRouter;

use \Facebook\HackRouter\Tests\TestRouter;
use \Zend\Diactoros\ServerRequest;
use type Facebook\HackRouter\Tests\TestRouter;
use type Zend\Diactoros\ServerRequest;
use function Facebook\FBExpect\expect;
use namespace HH\Lib\{C, Dict, Str};
use namespace HH\Lib\Dict;

final class RouterTest extends \PHPUnit_Framework_TestCase {
const keyset<string> MAP = keyset[
Expand Down Expand Up @@ -100,7 +100,7 @@ public function expectedMatchesWithResolvers(

/** @dataProvider getAllResolvers */
public function testMethodNotAllowedResponses(
string $name,
string $_name,
(function(dict<HttpMethod, dict<string, string>>): IResolver<string>) $factory
): void {
$map = dict[
Expand Down Expand Up @@ -148,7 +148,7 @@ public function testMatchesPattern(
* @dataProvider expectedMatchesWithResolvers
*/
public function testAllResolvers(
string $resolver_name,
string $_resolver_name,
IResolver<string> $resolver,
string $in,
string $expected_responder,
Expand Down
4 changes: 2 additions & 2 deletions tests/UriBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

namespace Facebook\HackRouter;

use \Facebook\HackRouter\Tests\TestIntEnum;
use \Facebook\HackRouter\Tests\TestStringEnum;
use type Facebook\HackRouter\Tests\TestIntEnum;
use type Facebook\HackRouter\Tests\TestStringEnum;

final class UriBuilderTest extends \PHPUnit_Framework_TestCase {
public function testLiteral(): void {
Expand Down
4 changes: 2 additions & 2 deletions tests/UriPatternTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

namespace Facebook\HackRouter;

use \Facebook\HackRouter\Tests\TestStringEnum;
use \Facebook\HackRouter\Tests\TestIntEnum;
use type Facebook\HackRouter\Tests\TestStringEnum;
use type Facebook\HackRouter\Tests\TestIntEnum;

final class UriPatternTest extends \PHPUnit_Framework_TestCase {
public function testLiteral(): void {
Expand Down

0 comments on commit c3bc8cd

Please sign in to comment.