Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Normalize console command descriptions #1503

Merged
merged 3 commits into from
Dec 14, 2023
Merged

Conversation

caendesilva
Copy link
Member

Crude script to get a good overview of all of these

<?php

// Create a list of all console command descriptions in the Framework package.

require_once __DIR__.'/../vendor/autoload.php';

$html = '';

$classes = (new \Illuminate\Filesystem\Filesystem())->allFiles(__DIR__.'/../packages/framework/src/Console/Commands');

foreach ($classes as $class) {
    $source = file_get_contents($class->getPathname());
    $description = 'No description found';
    foreach (explode("\n", $source) as $line) {
        if (str_contains($line, 'protected $description')) {
            $description = trim(str_replace(['protected $description = ', ';', "'"], '', $line));
            break;
        }
    }
    $name = str_replace('.php', '', $class->getFilename());
    $path = str_replace('\\', '/', substr($class->getPathname(), strlen(__DIR__.'/../packages/framework/src/')));
    $html .= sprintf('<tr><td><a href="%s">%s</a></td><td>%s</td></tr>'."\n", $path, $name, $description);
}


$html = "<table><tbody>{$html}</tbody></table>";
file_put_contents(__DIR__.'/framework-console-commands.html', $html);
echo $html;

It's nice to have a consistent style for this, and Laravel doesn't use trailing periods here, so neither should we.
@caendesilva caendesilva marked this pull request as ready for review December 14, 2023 14:22
Copy link

codecov bot commented Dec 14, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (56f3bf8) 100.00% compared to head (e48dd97) 100.00%.

Additional details and impacted files
@@              Coverage Diff              @@
##              master     #1503     +/-   ##
=============================================
  Coverage     100.00%   100.00%             
- Complexity      1740      3480   +1740     
=============================================
  Files            180       360    +180     
  Lines           4715      9430   +4715     
=============================================
+ Hits            4715      9430   +4715     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@caendesilva caendesilva merged commit b9077e7 into master Dec 14, 2023
19 checks passed
@caendesilva caendesilva deleted the normalize-code-style branch December 14, 2023 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant