Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The updated tests contain invalid instantiation (new $this->domainSearcher) and the CircleCI artifacts configuration still references removed php-cs-fixer logs, which will break execution/reporting.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR migrates the project’s PHP formatting workflow from PHP-CS-Fixer to Laravel Pint and applies Pint-driven formatting/docblock adjustments across the package source and test suite.
Changes:
- Replace PHP-CS-Fixer tooling with Laravel Pint (new
pint.json, updatedcomposer.json, removed.php-cs-fixer.php). - Update CircleCI “code_analysis” job to run Pint and generate formatter reports.
- Apply formatting/import ordering and PHPDoc cleanup updates across
src/andtests/.
File summaries
| File | Description |
|---|---|
| tests/WeightedSearchTest.php | Import ordering, PHPDoc type aliasing, and setUp() visibility alignment. |
| tests/TestCase.php | Import ordering and PHPDoc type aliasing. |
| tests/SearchQueryTest.php | Import ordering, PHPDoc type aliasing, and setUp() visibility alignment. |
| tests/PrefixSearchTest.php | Import ordering, PHPDoc type aliasing, and setUp() visibility alignment. |
| tests/PartialSearchTest.php | Import ordering, PHPDoc type aliasing, and setUp() visibility alignment. |
| tests/Models/User.php | Import ordering updates. |
| tests/Models/Ticket.php | Import ordering updates. |
| tests/ExactSearchTest.php | Import ordering, PHPDoc type aliasing, and setUp() visibility alignment. |
| tests/CustomSearchTest.php | Formatting updates plus custom-search test wiring adjustments. |
| src/Weights.php | Import ordering and PHPDoc cleanup. |
| src/Searchable.php | Import ordering, minor instantiation style change, and PHPDoc cleanup. |
| src/Requests/SearchRequest.php | Add exception import and simplify PHPDoc. |
| src/Contracts/Search.php | Import ordering and PHPDoc simplification. |
| src/Concerns/ExtractsQuotedPhrases.php | PHPDoc cleanup. |
| src/Aspects/SearchPrefix.php | Import ordering, constructor formatting, and PHPDoc adjustments. |
| src/Aspects/SearchPartial.php | Import ordering and PHPDoc adjustments. |
| src/Aspects/SearchJson.php | Import ordering and PHPDoc adjustments. |
| src/Aspects/SearchExact.php | Import ordering and PHPDoc adjustments. |
| src/Aspects/SearchAspect.php | Constructor formatting and PHPDoc adjustments. |
| pint.json | New Pint configuration (Laravel preset + rule tweaks). |
| database/factories/UserFactory.php | Import ordering updates. |
| database/factories/TicketFactory.php | Import ordering updates. |
| composer.json | Remove friendsofphp/php-cs-fixer, add laravel/pint to require-dev. |
| .php-cs-fixer.php | Remove PHP-CS-Fixer configuration file. |
| .circleci/config.yml | Replace PHP-CS-Fixer job step with Pint execution/reporting. |
Review details
Suppressed comments (5)
tests/CustomSearchTest.php:81
$this->domainSearcheris an object;new $this->domainSearcheris invalid PHP. Pass theSearchinstance directly.
->searchUsing([SearchAspect::custom('email', new $this->domainSearcher)])
src/Aspects/SearchAspect.php:28
- The return PHPDoc references
\\App\\Models\\Search\\SearchAspect, but the method signature returnsself; the annotation should match.
/**
* @return \App\Models\Search\SearchAspect
*/
src/Aspects/SearchAspect.php:36
- The return PHPDoc references
\\App\\Models\\Search\\SearchAspect, but the method signature returnsself; the annotation should match.
/**
* @return \App\Models\Search\SearchAspect
*/
src/Aspects/SearchAspect.php:44
- The return PHPDoc references
\\App\\Models\\Search\\SearchAspect, but the method signature returnsself; the annotation should match.
/**
* @return \App\Models\Search\SearchAspect
*/
src/Aspects/SearchAspect.php:52
- The return PHPDoc references
\\App\\Models\\Search\\SearchAspect, but the method signature returnsself; the annotation should match.
/**
* @return \App\Models\Search\SearchAspect
*/
- Files reviewed: 26/26 changed files
- Comments generated: 8
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| // When | ||
| $results = User::query() | ||
| ->searchUsing([SearchAspect::custom('email', new $this->domainSearcher())]) | ||
| ->searchUsing([SearchAspect::custom('email', new $this->domainSearcher)]) |
| - run: | ||
| name: PHP CS Fixer | ||
| command: | | ||
| mkdir -p ./logs/phpcsfixer | ||
| vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.php --diff --dry-run --format=junit > logs/phpcsfixer/junit.xml | ||
| name: Pint | ||
| command: | | ||
| mkdir -p ./logs/pint | ||
| vendor/bin/pint --test --format=junit > logs/pint/junit.xml |
| /** | ||
| * @param string $name | ||
| * @param int $weight | ||
| * @return \App\Models\Search\SearchAspect | ||
| */ |
| * @param Builder<Model> $query | ||
| * @return mixed | ||
| * | ||
| * @throws \InvalidArgumentException | ||
| * | ||
| * @return mixed | ||
| */ |
| * @param Builder<Model> $query | ||
| * @return mixed | ||
| * | ||
| * @throws \InvalidArgumentException | ||
| * | ||
| * @return mixed | ||
| */ |
| * @param Builder<Model> $query | ||
| * @return mixed | ||
| * | ||
| * @throws \InvalidArgumentException | ||
| * | ||
| * @return mixed | ||
| */ |
| /** | ||
| * @param \Illuminate\Database\Eloquent\Builder<TModelClass> $query | ||
| * @param \TestMonitor\Searchable\Weights $weights | ||
| * @param string $property | ||
| * @param string $term | ||
| * @param int $weight | ||
| * @param Builder<TModelClass> $query | ||
| * @return mixed | ||
| */ |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
| * @param \TestMonitor\Searchable\Contracts\Search $searchClass | ||
| * @param int $weight | ||
| */ | ||
| public function __construct(protected string $name, protected Search $searchClass, protected int $weight = 1) |
There was a problem hiding this comment.
We usually add a newline for each argument?
| <!--<file>app</file>--> | ||
|
|
||
| <exclude-pattern>*/Standards/*/Tests/*.(inc|css|js)</exclude-pattern> | ||
| <ruleset name="eloquent-revisable"> |
There was a problem hiding this comment.
PHPCS is not in the title?
No description provided.