Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ Entries below `Unreleased` are written by CI from the GitHub release body — se
## [Unreleased]
### Fixed

- **`composer rector` failed with `Class "Rector\Transform\ValueObject\ArrayDimFetchToMethodCall" not found`.**
rector/rector 2.8.0 removed that class, and driftingly/rector-laravel 2.7.0, which `^2.3` still allowed beside
it, uses it in its array-access set. The floor is now `^2.7.1`, the first release without it, so the required
`rector` check cannot resolve the broken pair.
- **The code-style CI job was formatting against Pint's defaults, not the shared laranail config.**
`fix-php-code-style-issues.yml` ran `aglipanci/laravel-pint-action` with `configPath: pint.json` -
a file this package does not ship. Pint handed a config path that does not exist falls back to its
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"symfony/process": "^7.4 || ^8.0"
},
"require-dev": {
"driftingly/rector-laravel": "^2.3",
"driftingly/rector-laravel": "^2.7.1",
"laranail/phone": "^0.1",
"laranail/validation-js": "^0.1",
"larastan/larastan": "^3.9.3",
Expand Down
6 changes: 6 additions & 0 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use Rector\CodeQuality\Rector\BooleanOr\RepeatedOrEqualToInArrayRector;
use Rector\CodeQuality\Rector\ClassMethod\InlineArrayReturnAssignRector;
use Rector\Privatization\Rector\ClassMethod\PrivatizeFinalClassMethodRector;
use RectorLaravel\Rector\Class_\RemoveDefaultAuthorizeTrueFromFormRequestRector;
use Rector\TypeDeclaration\Rector\ArrowFunction\AddArrowFunctionReturnTypeRector;

return RectorConfig::configure()
Expand Down Expand Up @@ -81,6 +82,11 @@
// links without changing their subject — both produce failing
// (or nonsensical) assertions. mrpunyapal/rector-pest 0.2.17.
UseToMatchRector::class,
// rector-laravel 2.7 deletes an authorize() that returns true. Laravel
// treats a missing authorize() as authorized, so src behaves the same,
// but the test fixtures define it on purpose (AuthorizedEach...,
// MergeRulesBaseRequest) to cover the path where the method exists.
RemoveDefaultAuthorizeTrueFromFormRequestRector::class,
// Hot-path closure allocates a literal array on every invocation
// when in_array() is used. Explicit === comparisons avoid that.
RepeatedOrEqualToInArrayRector::class => [
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/DoctorCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function handle(RuleRegistrar $registrar): int

return is_array($config) && $config !== []
? ['OK', 'flat laranail.validation key present']
: ['FAIL', 'config(\'laranail.validation\') is empty — provider not registered?'];
: ['FAIL', "config('laranail.validation') is empty — provider not registered?"];
}],
['rule registry', function () use ($registrar): array {
$count = count($registrar->classes());
Expand Down
4 changes: 2 additions & 2 deletions src/Exceptions/TypedBuilderHint.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ public static function for(string $method): ?string
private static function specialCase(string $method): ?string
{
return match ($method) {
'accepted' => 'Use `FluentRule::accepted()` for permissive accepted values (`\'yes\'`, `\'on\'`, `\'1\'`, `true`). Avoid `FluentRule::boolean()->accepted()` — the `boolean` base rule rejects `\'yes\'`/`\'on\'`.',
'accepted' => "Use `FluentRule::accepted()` for permissive accepted values (`'yes'`, `'on'`, `'1'`, `true`). Avoid `FluentRule::boolean()->accepted()` — the `boolean` base rule rejects `'yes'`/`'on'`.",
'declined' => "Use `FluentRule::boolean()->declined(...)` for strict boolean-only input. If HTML form values (`'no'`, `'off'`) need to pass, use `->rule('declined')` on the untyped builder instead.",
'size' => 'No `size()` method — use `->exactly(...)` on a typed builder. (This package renames Laravel\'s `size:` rule to `exactly()` for clarity.)',
'size' => "No `size()` method — use `->exactly(...)` on a typed builder. (This package renames Laravel's `size:` rule to `exactly()` for clarity.)",
'gt', 'gte', 'lt', 'lte' => 'No `gt()`/`lt()` methods — use `FluentRule::numeric()->greaterThan(FIELD)`, `->greaterThanOrEqualTo(FIELD)`, `->lessThan(FIELD)`, `->lessThanOrEqualTo(FIELD)`.',
'alphaNum' => 'No `alphaNum()` method — use `FluentRule::string()->alphaNumeric(...)`.',
'contains' => 'Use `FluentRule::array()->contains(...)` (this package exposes `contains` on `array()`, not `string()`).',
Expand Down
3 changes: 2 additions & 1 deletion tests/Rules/Markup/XmlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

declare(strict_types=1);

use Illuminate\Support\Facades\File;
use Illuminate\Contracts\Translation\Translator;
use Simtabi\Laranail\Validation\Rules\Markup\Xml;
use Illuminate\Translation\PotentiallyTranslatedString;
Expand Down Expand Up @@ -69,7 +70,7 @@
->and(ruleAccepts($rule, '<invoice><total>ten</total></invoice>'))->toBeFalse()
->and(ruleAccepts($rule, '<order><total>10.50</total></order>'))->toBeFalse();

@unlink($schema);
File::delete($schema);
});

it('blames the deployment, not the document, when the schema is missing', function (): void {
Expand Down
Loading