Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Updated access modifiers from private to protected across multiple files #249

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

Open
andrey-helldar wants to merge 1 commit into laravel:main
base: main
Choose a base branch
Loading
from andrey-helldar:patch/2025-09-06/17-31
Open
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
14 changes: 7 additions & 7 deletions src/BoostServiceProvider.php
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function boot(Router $router): void
}
}

private function registerPublishing(): void
protected function registerPublishing(): void
{
if ($this->app->runningInConsole()) {
$this->publishes([
Expand All @@ -85,7 +85,7 @@ private function registerPublishing(): void
}
}

private function registerCommands(): void
protected function registerCommands(): void
{
if ($this->app->runningInConsole()) {
$this->commands([
Expand All @@ -96,7 +96,7 @@ private function registerCommands(): void
}
}

private function registerRoutes(): void
protected function registerRoutes(): void
{
Route::post('/_boost/browser-logs', function (Request $request) {
$logs = $request->input('logs', []);
Expand Down Expand Up @@ -151,7 +151,7 @@ private static function buildLogMessageFromData(array $data): string
return implode(' ', $messages);
}

private function registerBrowserLogger(): void
protected function registerBrowserLogger(): void
{
config([
'logging.channels.browser' => [
Expand All @@ -163,7 +163,7 @@ private function registerBrowserLogger(): void
]);
}

private function registerBladeDirectives(BladeCompiler $bladeCompiler): void
protected function registerBladeDirectives(BladeCompiler $bladeCompiler): void
{
$bladeCompiler->directive('boostJs', fn () => '<?php echo \\Laravel\\Boost\\Services\\BrowserLogger::getScript(); ?>');
}
Expand All @@ -178,14 +178,14 @@ private static function mapJsTypeToPsr3Level(string $type): string
};
}

private function hookIntoResponses(Router $router): void
protected function hookIntoResponses(Router $router): void
{
$this->app->booted(function () use ($router) {
$router->pushMiddlewareToGroup('web', InjectBoost::class);
});
}

private function shouldRun(): bool
protected function shouldRun(): bool
{
if (! config('boost.enabled', true)) {
return false;
Expand Down
12 changes: 6 additions & 6 deletions src/Concerns/ReadsLogs.php
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,27 @@ trait ReadsLogs
* Regular expression fragments and default chunk-window sizes used when
* scanning log files. Declaring them once keeps every consumer in sync.
*/
private function getTimestampRegex(): string
protected function getTimestampRegex(): string
{
return '\\[\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}\\]';
}

private function getEntrySplitRegex(): string
protected function getEntrySplitRegex(): string
{
return '/(?='.$this->getTimestampRegex().')/';
}

private function getErrorEntryRegex(): string
protected function getErrorEntryRegex(): string
{
return '/^'.$this->getTimestampRegex().'.*\\.ERROR:/';
}

private function getChunkSizeStart(): int
protected function getChunkSizeStart(): int
{
return 64 * 1024; // 64 kB
}

private function getChunkSizeMax(): int
protected function getChunkSizeMax(): int
{
return 1 * 1024 * 1024; // 1 MB
}
Expand Down Expand Up @@ -114,7 +114,7 @@ protected function readLastErrorEntry(string $logFile): ?string
*
* @return string[]
*/
private function scanLogChunkForEntries(string $logFile, int $chunkSize): array
protected function scanLogChunkForEntries(string $logFile, int $chunkSize): array
{
$fileSize = filesize($logFile);
if ($fileSize === false) {
Expand Down
42 changes: 21 additions & 21 deletions src/Console/InstallCommand.php
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function handle(CodeEnvironmentsDetector $codeEnvironmentsDetector, Herd
$this->outro();
}

private function bootstrap(CodeEnvironmentsDetector $codeEnvironmentsDetector, Herd $herd, Terminal $terminal): void
protected function bootstrap(CodeEnvironmentsDetector $codeEnvironmentsDetector, Herd $herd, Terminal $terminal): void
{
$this->codeEnvironmentsDetector = $codeEnvironmentsDetector;
$this->herd = $herd;
Expand All @@ -92,14 +92,14 @@ private function bootstrap(CodeEnvironmentsDetector $codeEnvironmentsDetector, H
$this->projectName = config('app.name');
}

private function displayBoostHeader(): void
protected function displayBoostHeader(): void
{
note($this->boostLogo());
intro('✦ Laravel Boost :: Install :: We Must Ship ✦');
note("Let's give {$this->bgYellow($this->black($this->bold($this->projectName)))} a Boost");
}

private function boostLogo(): string
protected function boostLogo(): string
{
return
<<<'HEADER'
Expand All @@ -112,21 +112,21 @@ private function boostLogo(): string
HEADER;
}

private function discoverEnvironment(): void
protected function discoverEnvironment(): void
{
$this->systemInstalledCodeEnvironments = $this->codeEnvironmentsDetector->discoverSystemInstalledCodeEnvironments();
$this->projectInstalledCodeEnvironments = $this->codeEnvironmentsDetector->discoverProjectInstalledCodeEnvironments(base_path());
}

private function collectInstallationPreferences(): void
protected function collectInstallationPreferences(): void
{
$this->selectedBoostFeatures = $this->selectBoostFeatures();
$this->selectedTargetMcpClient = $this->selectTargetMcpClients();
$this->selectedTargetAgents = $this->selectTargetAgents();
$this->enforceTests = $this->determineTestEnforcement(ask: false);
}

private function performInstallation(): void
protected function performInstallation(): void
{
$this->installGuidelines();

Expand All @@ -137,7 +137,7 @@ private function performInstallation(): void
}
}

private function discoverTools(): array
protected function discoverTools(): array
{
$tools = [];
$toolDir = implode(DIRECTORY_SEPARATOR, [__DIR__, '..', 'Mcp', 'Tools']);
Expand All @@ -158,7 +158,7 @@ private function discoverTools(): array
return $tools;
}

private function outro(): void
protected function outro(): void
{
$label = 'https://boost.laravel.com/installed';

Expand Down Expand Up @@ -188,7 +188,7 @@ private function outro(): void
echo $this->black($this->bold($text.$link)).$this->reset(PHP_EOL).$this->reset(PHP_EOL);
}

private function hyperlink(string $label, string $url): string
protected function hyperlink(string $label, string $url): string
{
return "033円]8;;{$url}007円{$label}033円]8;;033円\\";
}
Expand Down Expand Up @@ -229,7 +229,7 @@ protected function determineTestEnforcement(bool $ask = true): bool
/**
* @return Collection<int, string>
*/
private function selectBoostFeatures(): Collection
protected function selectBoostFeatures(): Collection
{
$defaultInstallOptions = ['mcp_server', 'ai_guidelines'];
$installOptions = [
Expand Down Expand Up @@ -271,7 +271,7 @@ protected function boostToolsToDisable(): array
/**
* @return Collection<int, CodeEnvironment>
*/
private function selectTargetMcpClients(): Collection
protected function selectTargetMcpClients(): Collection
{
if (! $this->shouldInstallMcp() && ! $this->shouldInstallHerdMcp()) {
return collect();
Expand All @@ -286,7 +286,7 @@ private function selectTargetMcpClients(): Collection
/**
* @return Collection<int, CodeEnvironment>
*/
private function selectTargetAgents(): Collection
protected function selectTargetAgents(): Collection
{
if (! $this->shouldInstallAiGuidelines()) {
return collect();
Expand All @@ -303,7 +303,7 @@ private function selectTargetAgents(): Collection
*
* @return array{scroll: int, required: bool, displayMethod: string}
*/
private function getSelectionConfig(string $contractClass): array
protected function getSelectionConfig(string $contractClass): array
{
return match ($contractClass) {
Agent::class => ['scroll' => 4, 'required' => false, 'displayMethod' => 'agentName'],
Expand All @@ -315,7 +315,7 @@ private function getSelectionConfig(string $contractClass): array
/**
* @return Collection<int, CodeEnvironment>
*/
private function selectCodeEnvironments(string $contractClass, string $label): Collection
protected function selectCodeEnvironments(string $contractClass, string $label): Collection
{
$allEnvironments = $this->codeEnvironmentsDetector->getCodeEnvironments();
$config = $this->getSelectionConfig($contractClass);
Expand Down Expand Up @@ -367,7 +367,7 @@ private function selectCodeEnvironments(string $contractClass, string $label): C
return $selectedClasses->map(fn ($className) => $availableEnvironments->first(fn ($env) => get_class($env) === $className));
}

private function installGuidelines(): void
protected function installGuidelines(): void
{
if (! $this->shouldInstallAiGuidelines()) {
return;
Expand Down Expand Up @@ -435,27 +435,27 @@ private function installGuidelines(): void
}
}

private function shouldInstallAiGuidelines(): bool
protected function shouldInstallAiGuidelines(): bool
{
return $this->selectedBoostFeatures->contains('ai_guidelines');
}

private function shouldInstallStyleGuidelines(): bool
protected function shouldInstallStyleGuidelines(): bool
{
return false;
}

private function shouldInstallMcp(): bool
protected function shouldInstallMcp(): bool
{
return $this->selectedBoostFeatures->contains('mcp_server');
}

private function shouldInstallHerdMcp(): bool
protected function shouldInstallHerdMcp(): bool
{
return $this->selectedBoostFeatures->contains('herd_mcp');
}

private function installMcpServerConfig(): void
protected function installMcpServerConfig(): void
{
if (! $this->shouldInstallMcp() && ! $this->shouldInstallHerdMcp()) {
return;
Expand Down Expand Up @@ -545,7 +545,7 @@ private function installMcpServerConfig(): void
/**
* Is the project actually using localization for their new features?
*/
private function detectLocalization(): bool
protected function detectLocalization(): bool
{
$actuallyUsing = false;

Expand Down
2 changes: 1 addition & 1 deletion src/Install/Detection/DetectionStrategyFactory.php
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function makeFromConfig(array $config): DetectionStrategy
return $this->make($type, $config);
}

private function inferTypeFromConfig(array $config): string|array
protected function inferTypeFromConfig(array $config): string|array
{
$typeMap = [
'files' => self::TYPE_FILE,
Expand Down
4 changes: 2 additions & 2 deletions src/Install/Detection/DirectoryDetectionStrategy.php
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function detect(array $config, ?Platform $platform = null): bool
return false;
}

private function expandPath(string $path, ?Platform $platform = null): string
protected function expandPath(string $path, ?Platform $platform = null): string
{
if ($platform === Platform::Windows) {
return preg_replace_callback('/%([^%]+)%/', function ($matches) {
Expand All @@ -56,7 +56,7 @@ private function expandPath(string $path, ?Platform $platform = null): string
return $path;
}

private function isAbsolutePath(string $path): bool
protected function isAbsolutePath(string $path): bool
{
return str_starts_with($path, '/') ||
str_starts_with($path, '\\') ||
Expand Down
2 changes: 1 addition & 1 deletion src/Install/GuidelineAssist.php
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function enums(): array
*
* @return array<string, string>
*/
private function discover(callable $cb): array
protected function discover(callable $cb): array
{
$classes = [];
$appPath = app_path();
Expand Down
2 changes: 1 addition & 1 deletion src/Install/GuidelineComposer.php
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ protected function guideline(string $path): array

private array $storedSnippets = [];

private function processBoostSnippets(string $content): string
protected function processBoostSnippets(string $content): string
{
return preg_replace_callback('/(?<!@)@boostsnippet\(\s*(?P<nameQuote>[\'"])(?P<name>[^1円]*?)1円(?:\s*,\s*(?P<langQuote>[\'"])(?P<lang>[^3円]*?)3円)?\s*\)(?P<content>.*?)@endboostsnippet/s', function ($matches) {
$name = $matches['name'];
Expand Down
2 changes: 1 addition & 1 deletion src/Install/GuidelineWriter.php
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public function write(string $guidelines): int
return $replaced ? self::REPLACED : self::NEW;
}

private function acquireLockWithRetry(mixed $handle, string $filePath, int $maxRetries = 3): void
protected function acquireLockWithRetry(mixed $handle, string $filePath, int $maxRetries = 3): void
{
$attempts = 0;
$delay = 100000; // Start with 100ms in microseconds
Expand Down
2 changes: 1 addition & 1 deletion src/Mcp/Tools/ListAvailableConfigKeys.php
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function handle(array $arguments): ToolResult
* @param array<int|string, string|array<int|string, string>> $array
* @return array<int|string, int|string>
*/
private function flattenToDotNotation(array $array, string $prefix = ''): array
protected function flattenToDotNotation(array $array, string $prefix = ''): array
{
$results = [];

Expand Down
2 changes: 1 addition & 1 deletion src/Mcp/Tools/ListRoutes.php
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function handle(array $arguments): ToolResult
/**
* @param array<string|bool> $options
*/
private function artisan(string $command, array $options = []): string
protected function artisan(string $command, array $options = []): string
{
$output = new BufferedOutput;
$result = Artisan::call($command, $options, $output);
Expand Down
4 changes: 2 additions & 2 deletions src/Middleware/InjectBoost.php
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function handle(Request $request, Closure $next): Response
return $response;
}

private function shouldInject(Response $response): bool
protected function shouldInject(Response $response): bool
{
$responseTypes = [
StreamedResponse::class,
Expand Down Expand Up @@ -66,7 +66,7 @@ private function shouldInject(Response $response): bool
return true;
}

private function injectScript(string $content): string
protected function injectScript(string $content): string
{
$script = BrowserLogger::getScript();

Expand Down
Loading

AltStyle によって変換されたページ (->オリジナル) /