Skip to content

Commit

Permalink
Merge pull request #9 from fbarrento/configure-pint
Browse files Browse the repository at this point in the history
chore: installs and configures pint.
  • Loading branch information
nunomaduro authored Feb 14, 2025
2 parents c5469aa + 05556eb commit 67525c2
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 2 deletions.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
]
},
"require-dev": {
"laravel/pint": "^1.20",
"pestphp/pest-dev-tools": "^3.4.0"
},
"minimum-stability": "dev",
Expand Down
58 changes: 58 additions & 0 deletions pint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"preset": "laravel",
"rules": {
"array_push": true,
"backtick_to_shell_exec": true,
"date_time_immutable": true,
"declare_strict_types": true,
"lowercase_keywords": true,
"lowercase_static_reference": true,
"final_class": true,
"final_internal_class": true,
"final_public_method_for_abstract_class": true,
"fully_qualified_strict_types": true,
"global_namespace_import": {
"import_classes": true,
"import_constants": true,
"import_functions": true
},
"mb_str_functions": true,
"modernize_types_casting": true,
"new_with_parentheses": false,
"no_superfluous_elseif": true,
"no_useless_else": true,
"no_multiple_statements_per_line": true,
"ordered_class_elements": {
"order": [
"use_trait",
"case",
"constant",
"constant_public",
"constant_protected",
"constant_private",
"property_public",
"property_protected",
"property_private",
"construct",
"destruct",
"magic",
"phpunit",
"method_abstract",
"method_public_static",
"method_public",
"method_protected_static",
"method_protected",
"method_private_static",
"method_private"
],
"sort_algorithm": "none"
},
"ordered_interfaces": true,
"ordered_traits": true,
"protected_to_private": true,
"self_accessor": true,
"self_static_accessor": true,
"strict_comparison": true,
"visibility_required": true
}
}
2 changes: 1 addition & 1 deletion src/Compiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ final class Compiler
* @param array<int, Operation> $operations
*/
public function __construct(
private array $operations
private readonly array $operations
) {
//
}
Expand Down
2 changes: 1 addition & 1 deletion src/Operations/ToHaveTitle.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ public function __construct(

public function compile(): string
{
return sprintf("await expect(page).toHaveTitle(/%s/);", $this->title);
return sprintf('await expect(page).toHaveTitle(/%s/);', $this->title);
}
}
12 changes: 12 additions & 0 deletions src/PendingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,28 @@

namespace Pest\Browser;

use Pest\Browser\Contracts\Operation;

/**
* @internal
*/
final class PendingTest
{
/**
* The pending operations.
*
* @var array<int, Operation>
*/
private array $operations = [];

/**
* Ends the chain and builds the test result.
*/
public function __destruct()
{
$this->build();

Check failure on line 26 in src/PendingTest.php

View workflow job for this annotation

GitHub Actions / Static Tests (prefer-lowest)

Call to an undefined method Pest\Browser\PendingTest::build().

Check failure on line 26 in src/PendingTest.php

View workflow job for this annotation

GitHub Actions / Static Tests (prefer-stable)

Call to an undefined method Pest\Browser\PendingTest::build().
}

/**
* Visits a URL.
*/
Expand Down
2 changes: 2 additions & 0 deletions tests/Example.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

use function Pest\Browser\visit;

it('may have a title at playwright', function () {
Expand Down

0 comments on commit 67525c2

Please sign in to comment.