Coder Social home page Coder Social logo

laravel / pint Goto Github PK

View Code? Open in Web Editor NEW
2.7K 35.0 125.0 257.95 MB

Laravel Pint is an opinionated PHP code style fixer for minimalists.

Home Page: https://laravel.com

License: MIT License

PHP 96.69% Blade 3.31%
php format formatter lint linter

pint's Introduction

Logo Laravel Pint

Overview Laravel Pint

Build Status Total Downloads Latest Stable Version License

Introduction

Laravel Pint is an opinionated PHP code style fixer for minimalists. Pint is built on top of PHP-CS-Fixer and makes it simple to ensure that your code style stays clean and consistent.

Official Documentation

Documentation for Pint can be found on the Laravel website.

Contributing

Thank you for considering contributing to Pint! You can read the contribution guide here.

Code of Conduct

In order to ensure that the Laravel community is welcoming to all, please review and abide by the Code of Conduct.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

License

Pint is open-sourced software licensed under the MIT license.

pint's People

Contributors

claudiodekker avatar driesvints avatar edwinvdpol avatar fieu avatar finagin avatar goodjack avatar grahamcampbell avatar hjanos1 avatar jasonmccreary avatar jbrooksuk avatar jimmyklein-actual avatar joelbutcher avatar jrseliga avatar jubeki avatar kevinpijning avatar localheinz avatar lucasmichot avatar michalkortas avatar milewski avatar nunomaduro avatar otsch avatar parth391 avatar rigby90 avatar shivammathur avatar shuvroroy avatar tatsurou-yajima avatar taylorotwell avatar vinkla avatar wouterrutgers avatar zepfietje avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pint's Issues

Target class [router] does not exist

  • Pint Version: 0.1.5
  • PHP Version: 8.0.20

Description:

I've tried this in two local Lara projects. Running ./vendor/bin/pint results in an error shown below

image

Steps To Reproduce:

composer require laravel/pint --dev

then

./vendor/bin/pint

Am I missing something?

`if/else` statement spacing

Currently, Laravel Pint converts this:

<?php

if($something) {
  // ...
}

to:

<?php

if ($something) {
  // ...
}

It appears that it is the braces rule that changes this, which is odd.

Is there any way to either disable this functionality, or better yet make Laravel Pint actually fix to the first one?

per directory pint.json parsing

This might be a bit farfetched but with all the mono-repo rage (and i.e. having a cross PHP version phar source in a larger project) one might want Pint to check everywhere but read the pint.json in the current working directory...

This is alot like how .gitignore works when placing it into a subdirectory and such. This would allow bigger repositories to have multiple rulesets, rules or even presets between directories and still "only" have the single pint command to fix it all ;)

Thanks!

Segmentation fault analyzing big file

  • Pint Version: 0.2.3
  • PHP Version: 8.0.20 / 8.1.7

Description:

Running pint on a project with a very big seeder (10768002 bytes) produces a segfault.

Steps To Reproduce:

Create a seeder with a collection of very big arrays. My case was with 160 insert statements, each with 500 array items, like the following.

DB::table('cities')->insert([
    [
        'id' => 1,
        'nombre' => 'Guangzhou',
        'pais_id' => '1',
    ],
...
    [
        'id' => 500,
        'nombre' => 'Fotang',
        'pais_id' => '1',
    ],
]);

I know we can exclude specific files with configuration rules, but it crashes... I'll expect the tool can check file size before checking a file and issue a warning, skipping the file and following with the next files. It's difficult to known what file was causing the segfault, because the tool doesn't provide an option to show files being analyzed or log progress to a file.

Enum cases should not be altered

  • Pint Version: 0.1.5
  • PHP Version: 8.1.1

Description:

Enum cases should not be reformatted even regardless of keyword name.

Enum class: app/Enum/SegmentCastMissingAs.php

namespace App\Enum;

enum SegmentCastMissingAs: string
{
    case NULL = 'null';
    case FALSE = 'false';
    case TRUE = 'true';
    case EMPTY_STRING = 'empty_string';
    case ZERO = 'zero';
    case IGNORE = 'ignore';
}

Pint change this style using Laravel preset:

-case NULL = 'null';
-case FALSE = 'false';
-case TRUE = 'true';
+case null = 'null';
+case false = 'false';
+case true = 'true';
case EMPTY_STRING = 'empty_string';
case ZERO = 'zero';
case IGNORE = 'ignore';

Steps To Reproduce:

  1. create class app/Enum/SegmentCastMissingAs.php
  2. Run /vendor/bin/pint --preset laravel app/Enum/SegmentCastMissingAs.php

fixing unused variables in use statements on mac osx leads to trailing spaces

  • Pint Version: 0.2.1
  • PHP Version: 8.1.6

Description:

This happens on OSX (Intel). When pint removes unused variables in use statements of closures, it adds spaces before the commas. The validation then passes running pint --test and no files need fixing. However, when I run the same command as part of my CI/CD pipeline on a CircleCI image, the files are flagged as breaking style convention.

Steps To Reproduce:

original code

$img->text($this->getUnicodeCharFromIcon($icon), ($size / 2) + $hoffset, ($size / 2) + $voffset, function ($font) use ($icon, $img, $size, $iconSize, $large_color, $small_color) {
            $font->file($this->getIconFontPath($icon));
            $font->size($iconSize);
            $font->color($small_color ?: $large_color);
            $font->align('center');
            $font->valign('center');
        });

run fix on osx

./vendor/bin/pint

fixed code for reference

 $small_color = data_get($params, 'color') ?: null;
        $img->text($this->getUnicodeCharFromIcon($icon), ($size / 2) + $hoffset, ($size / 2) + $voffset, function ($font) use ($icon  , $iconSize, $large_color, $small_color) {
            $font->file($this->getIconFontPath($icon));
            $font->size($iconSize);
            $font->color($small_color ?: $large_color);
            $font->align('center');
            $font->valign('center');
        });

run test on osx (will pass)

./vendor/bin/pint --test

run fix on linux machine (fails)

./vendor/bin/pint --test

Different test results depending on environment

  • Pint Version: 0.1.3
  • PHP Version: 8.0.13 and 8.0.19

Description:

I get different results depending on where I start pint.

Running in sail with PHP 8.0.19: ./vendor/bin/pint --test => PASS

Running on MacOS with PHP 8.0.13: : ./vendor/bin/pint --test => FAIL

I assume, formatting has nothing to do with the PHP version. Can someone explain this to me?

pint-output

Allow to format only specific files

Based on issue #17, in my opinion being able to provide just a single file is a limitation that prevents usages with certain cases where we'd like to use this library to lint selected files, for example in case of pre-commit linting. Using the command to lint file by file would propably be a lot slower due to warm-up so being able to do

pint file1 file2 file3

or pint --file=file1 --file=file2

would propably be a much better idea.

cs2pr support?

i like to use cs2pr to get pr annotations for php-cs-fixer issues

here's a rough example github workflow :

name: Lint

jobs:
  lint:
      - name: Setup PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: '8.0'
          tools: cs2pr

      - name: Run PHP Coding Standards Fixer
        run: vendor/bin/php-cs-fixer fix --dry-run --format=checkstyle | cs2pr

it would be great if pint supported github pr annotations

Incorrect PHPDoc Formatting

  • Pint Version: 0.1.0
  • PHP Version: 8.1.6

Description:

The Laravel Code Style has the following style throughout the source code:

laravel_phpdoc_alignment

After @param should be two spaces then a type-hint then another two spaces and then the $variable

  /**
   * Here is a description for what the function does
-  * @param string $foo
+  * @param  string  $foo
   * @return string
   */
  public function bar($foo) {}

laravel_phpdoc_order

First should be the description after that @param then @return and at last @throws
The default rule phpdoc_order has a different order: description, @param, @throws, @return

  /**
   * Here is a description for what the function does
   * @param string $foo
   * @param  string  $foo
-  * @throws \Exception
   * @return string
+  * @throws \Exception
   */
  public function bar($foo) {}

laravel_phpdoc_seperation

Between each group of tags should be an empty line for seperation. @param and @return are always of the same group and are not to be seperated with an empty line.
The default behaviour for phpdoc_seperation is also an empty line between @param and @return.

  /**
   * Here is a description for what the function does
+  *
   * @param string $foo
   * @param  string  $foo
-  *
   * @return string
+  *
   * @throws \Exception
   */
  public function bar($foo) {}

Steps To Reproduce:

  1. Create Fixtures for the example
  2. Run pint
  3. Check the result remains unchanged

Possible Solution

Since there are no default rules for PHP-CS-Fixer I created custom ones.
There are three Fixers for PHP-CS-Fixer which could be included here.
https://github.com/Jubeki/laravel-code-style/tree/main/src/Fixers

Do you have an interest in a PR?

Conflict "single_import_per_statement" with "group_import" rule

Versions

  • Pint Version: 0.2.3
  • PHP Version: 8.1.8

Description:

When I run the command ./vendor/bin/pint I got an error

Steps To Reproduce:

run in the terminal ./vendor/bin/pint
My pint.json

{
    "preset": "laravel",
    "rules": {
        "@PSR2": true,
        "@PSR12": true,
        "group_import": true, 
        "array_indentation": true
    }
}

image

What's the advantage over PHP-CS-Fixer

Could there be two sentences about why to use Pint over PHP-CS-Fixer?

I imagine the output might be more enjoyable and I imagine the installation being easier.

Is that correct?
But likely pint could get old as it comes bundled with a PHP-CS-Fixer, right?

UI view

I hope the package can render with UI soon!

UNC paths as argument throws error

  • Pint Version: 0.2.1
  • PHP Version: 8.0.13 (locally installed on Windows)

Description:

I'm using WSL2 with Sail. At this point, I'm trying to use PHPStorm to automatically run Pint on the current PHP file, which works correctly when I'm on a local path.

The issue comes when you open a project from the WSL UNC path (network share). For instance, my project is located at \\WSL$\UBUNTU\home\morfra\code\XXX

Here is the full error when running the following command:

cmd.exe /D /C call C:\Users\morfra\AppData\Roaming\Composer\vendor\bin\pint.bat \\wsl$\Ubuntu\home\morfra\code\XXX\app\Http\Middleware\RecordPageViewsToActivityLog.php
'\\wsl$\Ubuntu\home\morfra\code\XXX'
In Runner.php line 242:
                                                                                                                       
  Cannot write to file "\\WSL$\UBUNTU\home\morfra\code\refonte-intranet\app\Http\Middleware\RecordPageViewsToActivity  
  Log.php" as it is not writable.

That being said, Windows specifically says "UNC paths are not supported in CMD", but I've never had any issues with other scripts running like that.

Steps To Reproduce:

Run the pint.bat command from Windows against a UNC path:
pint.bat "\\wsl$\Ubuntu\home\morfra\code\XXX\app\Http\Middleware\RecordPageViewsToActivityLog.php"

Max line length

Hello,

Sorry about the title was not really sure what to call it, I'm not sure if this is within the scope of the Pint project but through Laravel long lines are broken up into multiple lines example from FormRequest

return $factory->make(
            $this->validationData(), $this->container->call([$this, 'rules']),
            $this->messages(), $this->attributes()
        )->stopOnFirstFailure($this->stopOnFirstFailure);

Would be nice if pint was able to detect and "fix" long lines like the above.

In Style.php line 1012

  • Pint Version: 0.1.7
  • PHP Version: 8.1.5

Description:

./vendor/bin/pint --test is throwing this error


In Styles.php line 1012:
                                                                    
  [Error]                                                           
  Call to undefined function Termwind\ValueObjects\mb_strimwidth()  
                                                                    

Exception trace:
  at phar:///home/(project_path)/vendor/laravel/pint/builds/pint/vendor/nunomaduro/termwind/src/ValueObjects/Styles.php:1012
 Termwind\ValueObjects\Styles::trimText() at phar:///home/(project_path)/vendor/laravel/pint/builds/pint/vendor/nunomaduro/termwind/src/ValueObjects/Styles.php:833

Ability to use laravel preset with php-cs-fixer

As far as I know this is the only official Laravel code style preset. It would be nice if I could also use the rule preset with standard php-cs-fixer if I do not want to use the pint command. Pint makes things easy but since it is a layer on top of php-cs-fixer it does not have the full power and customization that php-cs-fixer allows.

For example, being able to reference @Laravel like this in .php-cs-fixer.dist.php

<?php

$finder = PhpCsFixer\Finder::create()
    ->in(__DIR__)
    ->name('*.php')
    ->ignoreDotFiles(true)
    ->ignoreVCS(true);

return (new PhpCsFixer\Config())
    ->setUsingCache(true)
    ->setRiskyAllowed(true)
    ->setRules([
        '@PSR12' => true,
        '@Laravel' => true,
    ])
    ->setFinder($finder);

some rules with psr-12 preset seems incorrect

  • Pint Version: 0.2.3
  • PHP Version: 8.0.17

Description:

psr-12 preset is using incorrect if block structure with exclamation mark.

Steps To Reproduce:

run the linter with an if statement with exclamation mark.

1-
-            if (!empty($toRemove)) {

2-
+            if (! empty($toRemove)) {

also with docblocks:

1-
@param string $id
to
2-
@param  string  $id

and
1-
@param $id
to
2-
@param    $id

I would say 1st examples supposed to be correct or am I missing something here ?

another issue is the removal of spaces before and after the . is half compliant with PSR-12
as it only recoomends to do it the same throughout the project -> and we used to use " . " and not "." what is it converted to now:
https://stackoverflow.com/a/66033448/1194797
https://xoops.gitbook.io/xoops-modules-cookbook/coding-standards/standards/styleguide#concatenation

-                echo "Usage:" . PHP_EOL;
+                echo 'Usage:'.PHP_EOL;

thanks in advance.

Support for Blade views files

It would be helpful to add to PINT to correct views Blade files, e.g. as Tlint does...
Pint could fix e.g. :

  • {{$variable}} -> {{ $variable }} or
  • @if(!$variable) -> @if (! $variable) or
@props([
    'size'=>'normal',
    'decorator' => false,
    'title' =>''
])

->

@props ([
    'size'      => 'normal',
    'decorator' => false,
    'title'     => '',
])
  • etc.

Null Safe Operator removed

  • Pint Version: 0.2.1
  • PHP Version: 8.1.3

Description:

pint is removing the null safe operator whilst fixing other issues. So before applying pint I have the following:

$result = $something?->else;

And after running pint

$result = $somethingelse;

After running some tests it seems to happen reliably when fixing other issues, for instance when reformatting braces, as shown below...

Steps To Reproduce:

  1. Install a new Laravel app.
  2. Created a new model "Test"
  3. In Test.php created a new function:
    public function foo($something) {
        $result = $something?->else;
    }
  1. Run pint: ./vendor/bin/pint
  2. Fixes one issue

CleanShot 2022-06-28 at 13 41 57@2x

6. Fixes the brace but also removes the null safe operator
    public function foo($something)
    {
        $result = $somethingelse;
    }

If the brace was in the correct place to start with:

    public function foo($something)
    {
        $result = $something?->else;
    }

Then running pint finds nothing to change or fix.

copyrights/license violation

Hey.

I see we have yet another wrapper of https://github.com/FriendsOfPHP/PHP-CS-Fixer/ .
I think it's totally fine and I can only encourage you to consider to also contribute back to the main project, especially with the generic parts. We already made a lot of elements customizable via interfaces, and we could make more customizations for sure.

Same time, if you decide to COPY-PASTE the source file from PHP CS Fixer repo, please remember to keep respect the original ownership and license.


The 3 rules were created by copy-pasting them from main repo and doing small adjustments, eg LaravelPhpdocOrderFixer is clone of PhpdocOrderFixer with slight adjustments to match your custom needs (most of logic, variable names, description etc is copy-pasted).

It was also admitted openly in the PR that was introducing those files Screenshot 2022-06-25 at 12 07 11

You are totally OK to do that as long as you keep the copyrights and license. Please, let's have respect to one another work.

(...) The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. (...)

Shared rules across organisation

Hi,

I have a GitHub Org that has many Laravel apps. We currently have our own private coding standards repository which applies the same PHP CS Fixer rules across the organisation.

Is this same thing possible with Pint? We'd love to switch this over to use Pint but we don't really want to have to replicate the ruleset across all the applications, we'd rather this existed in a one centralised place across the whole organisation.

Cheers.

GrumPHP Task

Hi,
Is there exist task for GrumPHP to use Pint ?

->setIndent("\t")

With php-cs-fixer it is possible to define an Indent and Line Ending besides to the rules:

	->setIndent("\t")
	->setLineEnding("\n")
	->setRules([
     //...

Dont blame me for that, but i want to have tabs instead of spaces for Indentation.
Vanilla php-cs-fixer is doing that fine, but i dont see a way yet to set Indent and Line Ending in pint.json.

Language files xx.json sorted by keys

Since I frequently use multilingual applications and users often add new "sentences," then translation keys shouldn't be at the end in the xx.json file. It would be good for pint to check itself and possibly sort alphabetically by important key :)

Add an inclusion list that overrides the exclusion list

When I'm working on a package, I composer symlink to the package's dev folder, so I can work in my laravel app on the package.

I have the VS Code extension installed and it ignores the vendor folder, but I actually want it to format my package code, which is in the app's vendor folder.

Perhaps an include config that allows us to add specific folders that might otherwise be excluded?

Thanks!

Separate Trait Imports

Is it possible to separate the imports for traits? I couldn't find an option for this in php-cs-fixer but it may exist. Ideally, it would handle it similar to regular imports, one per Use statement.

Pint ignoring config file when processing single file

  • Pint Version: 0.1.5
  • PHP Version: 8.1.5

Description:

Pint seems to be ignoring my pint.json config when passing a file path.

CleanShot 2022-06-23 at 11 51 50@2x

CleanShot 2022-06-23 at 11 52 02@2x

Steps To Reproduce:

Add a pint.json with the following content:

{
    "preset": "laravel"
}

./vendor/bin/pint app/example/file.php - Laravel preset not applied
./vendor/bin/pint --preset=laravel app/example/file.php - Laravel preset applied

Allow to format only specific files

I believe it is an important feature to allow for passing list of files which should be formatted upon run instead of formatting all files. This is usable in case formatting is happening on pre-commit hook (for example in our case we have lint-staged configured which is formatting staged PHP files before commit). I don't see this anywhere as a documented feature and the command input arguments also does not seem to allow for this.

Getting phar error when running pint through Docker container

  • Pint Version: 0.1.7
  • PHP Version: 8.0

Description:

Hi there,

I'm trying to run pint in a Docker container using a Makefile.
I keep getting this error :

Failed to write file "/tmp/e4d04fcf8f1486030e6781b8ac00870c", "file_get_con tents(phar:///var/www/vendor/laravel/pint/builds/pint/.env): Failed to open stream: phar error: ".env" is not a file in phar "/var/www/vendor/laravel/ pint/builds/pint"".

Here is my Makefile entry :

@echo "Executing Laravel Pint...";\

docker-compose -f docker-compose.yml  exec -T workspace ./vendor/bin/pint ;\

echo "Job's done";\`

Cannot understand what pint is trying to do there.

When running it directly in Docker container everything works.

Do someone has any idea on how to solve this ?

Thanks in advance !

Error "Class DOMDocument not found"

  • Pint Version: 0.1.2
  • PHP Version: 8.0.20

Running using Laravel sail with Docker.

Description:

I get an error when running ./vendor/bin/pint. It prints out a couple of dots and checks, and then shows an exception:

./vendor/bin/pint -v

  ...........................................................................................
In HtmlRenderer.php line 32:
                                 
  [Error]                        
  Class "DOMDocument" not found  

This is the full trace with pint -v

Exception trace:
  at phar:///home/laura/PhpstormProjects/rm-notesync/vendor/laravel/pint/builds/pint/vendor/nunomaduro/termwind/src/HtmlRenderer.php:32
 Termwind\HtmlRenderer->parse() at phar:///home/laura/PhpstormProjects/rm-notesync/vendor/laravel/pint/builds/pint/vendor/nunomaduro/termwind/src/HtmlRenderer.php:24
 Termwind\HtmlRenderer->render() at phar:///home/laura/PhpstormProjects/rm-notesync/vendor/laravel/pint/builds/pint/vendor/nunomaduro/termwind/src/Functions.php:41
 Termwind\render() at phar:///home/laura/PhpstormProjects/rm-notesync/vendor/laravel/pint/builds/pint/app/Output/SummaryOutput.php:62
 App\Output\SummaryOutput->handle() at phar:///home/laura/PhpstormProjects/rm-notesync/vendor/laravel/pint/builds/pint/app/Actions/ElaborateSummary.php:47
 App\Actions\ElaborateSummary->App\Actions\{closure}() at phar:///home/laura/PhpstormProjects/rm-notesync/vendor/laravel/pint/builds/pint/vendor/illuminate/support/helpers.php:302
 tap() at phar:///home/laura/PhpstormProjects/rm-notesync/vendor/laravel/pint/builds/pint/app/Actions/ElaborateSummary.php:47
 App\Actions\ElaborateSummary->execute() at phar:///home/laura/PhpstormProjects/rm-notesync/vendor/laravel/pint/builds/pint/app/Commands/DefaultCommand.php:55
 App\Commands\DefaultCommand->handle() at phar:///home/laura/PhpstormProjects/rm-notesync/vendor/laravel/pint/builds/pint/app/Providers/CommandsServiceProvider.php:32
 App\Providers\CommandsServiceProvider->App\Providers\{closure}() at n/a:n/a
 call_user_func() at phar:///home/laura/PhpstormProjects/rm-notesync/vendor/laravel/pint/builds/pint/vendor/illuminate/container/Container.php:348
 Illuminate\Container\Container->callMethodBinding() at phar:///home/laura/PhpstormProjects/rm-notesync/vendor/laravel/pint/builds/pint/vendor/illuminate/container/BoundMethod.php:90
 Illuminate\Container\BoundMethod::callBoundMethod() at phar:///home/laura/PhpstormProjects/rm-notesync/vendor/laravel/pint/builds/pint/vendor/illuminate/container/BoundMethod.php:37
 Illuminate\Container\BoundMethod::call() at phar:///home/laura/PhpstormProjects/rm-notesync/vendor/laravel/pint/builds/pint/vendor/illuminate/container/Container.php:651
 Illuminate\Container\Container->call() at phar:///home/laura/PhpstormProjects/rm-notesync/vendor/laravel/pint/builds/pint/vendor/illuminate/console/Command.php:136
 Illuminate\Console\Command->execute() at phar:///home/laura/PhpstormProjects/rm-notesync/vendor/laravel/pint/builds/pint/vendor/symfony/console/Command/Command.php:291
 Symfony\Component\Console\Command\Command->run() at phar:///home/laura/PhpstormProjects/rm-notesync/vendor/laravel/pint/builds/pint/vendor/illuminate/console/Command.php:121
 Illuminate\Console\Command->run() at phar:///home/laura/PhpstormProjects/rm-notesync/vendor/laravel/pint/builds/pint/vendor/symfony/console/Application.php:998
 Symfony\Component\Console\Application->doRunCommand() at phar:///home/laura/PhpstormProjects/rm-notesync/vendor/laravel/pint/builds/pint/vendor/symfony/console/Application.php:299
 Symfony\Component\Console\Application->doRun() at phar:///home/laura/PhpstormProjects/rm-notesync/vendor/laravel/pint/builds/pint/vendor/symfony/console/Application.php:171
 Symfony\Component\Console\Application->run() at phar:///home/laura/PhpstormProjects/rm-notesync/vendor/laravel/pint/builds/pint/vendor/illuminate/console/Application.php:102
 Illuminate\Console\Application->run() at phar:///home/laura/PhpstormProjects/rm-notesync/vendor/laravel/pint/builds/pint/vendor/laravel-zero/foundation/src/Illuminate/Foundation/Console/Kernel.php:129
 Illuminate\Foundation\Console\Kernel->handle() at phar:///home/laura/PhpstormProjects/rm-notesync/vendor/laravel/pint/builds/pint/vendor/laravel-zero/framework/src/Kernel.php:96
 LaravelZero\Framework\Kernel->handle() at phar:///home/laura/PhpstormProjects/rm-notesync/vendor/laravel/pint/builds/pint/app/Kernel.php:19
 App\Kernel->handle() at phar:///home/laura/PhpstormProjects/rm-notesync/vendor/laravel/pint/builds/pint/pint:36
 require() at /home/laura/PhpstormProjects/rm-notesync/vendor/laravel/pint/builds/pint:14
 include() at /home/laura/PhpstormProjects/rm-notesync/vendor/bin/pint:120

Steps To Reproduce:

All I did was run pint -v, the project I'm working on is not open-source so I can't link that unfortunately.

Braces on migrations using Laravel preset

  • Pint Version: 0.1.3
  • PHP Version: 8.1.7

Description:

Laravel make:migration command create a migration file with braces on a new line. (e.g. https://github.com/laravel/laravel/blob/9.x/database/migrations/2019_12_14_000001_create_personal_access_tokens_table.php)

return new class extends Migration
{
    // ....
};

Pint change this style even using Laravel preset:

-return new class extends Migration
-{
+return new class extends Migration {
    // ...
};

Steps To Reproduce:

  1. Create a Laravel migration using artisan make:migration
  2. Run /vendor/bin/pint --preset laravel

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.