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

Apply fixes from StyleCI #367

Open
wants to merge 1 commit into
base: dependabot/composer/sentry/sentry-laravel-3.7.3
Choose a base branch
from
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
12 changes: 6 additions & 6 deletions domains/ConfigAdjustment/Concerns/MakesArchiveAdjustments.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ trait MakesArchiveAdjustments
* @throws ZipEntryNotFoundException
* @throws ZipException
*/
protected function replaceInFile(ZipFile $archive, string $file, array $replacements) : void
protected function replaceInFile(ZipFile $archive, string $file, array $replacements): void
{
$contents = $archive->getEntryContents($file);
$replacedContents = Str::replace(
Expand All @@ -38,20 +38,20 @@ protected function replaceInFile(ZipFile $archive, string $file, array $replacem
* @throws ZipEntryNotFoundException
* @throws ZipException
*/
protected function replaceEnvExample(ZipFile $archive, array $replacements) : void
protected function replaceEnvExample(ZipFile $archive, array $replacements): void
{
$this->replaceInFile($archive, '.env.example', $replacements);
}

protected function appendToFile(ZipFile $archive, string $file, string $append) : void
protected function appendToFile(ZipFile $archive, string $file, string $append): void
{
$originalContents = $archive->getEntryContents($file);

$archive->addFromString($file, $originalContents . $append);
$archive->addFromString($file, $originalContents.$append);
}

protected function addEnvExampleBlock(ZipFile $archive, string $block) : void
protected function addEnvExampleBlock(ZipFile $archive, string $block): void
{
$this->appendToFile($archive, ".env.example", "\n$block\n");
$this->appendToFile($archive, '.env.example', "\n$block\n");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ public function __construct(
) {
}

public function manipulate(ZipFile $archive, CreateProjectForm $form) : void
public function manipulate(ZipFile $archive, CreateProjectForm $form): void
{
$this->database->adjustDefaults($archive, $form->database->database);
$this->cache->adjustDefaults($archive, $form->cache->driver);
$this->broadcasting->adjustDefaults($archive, $form->broadcasting);
$this->search->adjustDefaults($archive, $form->search);
$this->flysystem->adjustDefaults($archive, $form->storage);
}
}
}
18 changes: 9 additions & 9 deletions domains/ConfigAdjustment/FlysystemAdjuster.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ class FlysystemAdjuster
public function adjustDefaults(
ZipFile $archive,
Storage $storage,
) : void {
$contents = $archive->getEntryContents("config/filesystems.php");
): void {
$contents = $archive->getEntryContents('config/filesystems.php');

$adjusted = $this->adjustContents($contents, $storage);
$this->adjustEnvExample($archive, $storage);

$archive->addFromString("config/filesystems.php", $adjusted);
$archive->addFromString('config/filesystems.php', $adjusted);
}

private function adjustEnvExample(ZipFile $archive, Storage $storage) : void
private function adjustEnvExample(ZipFile $archive, Storage $storage): void
{
if ($storage->usesFtp) {
$this->addEnvExampleBlock($archive, <<<'ENV'
Expand All @@ -50,7 +50,7 @@ private function adjustEnvExample(ZipFile $archive, Storage $storage) : void
}
}

public function adjustContents(string $contents, Storage $storage) : string
public function adjustContents(string $contents, Storage $storage): string
{
if ($storage->usesFtp) {
$contents = $this->prependFilesystemConfig($contents, $this->defaultFtpConfig());
Expand All @@ -63,14 +63,14 @@ public function adjustContents(string $contents, Storage $storage) : string
return $contents;
}

private function prependFilesystemConfig(string $config, string $entry) : string
private function prependFilesystemConfig(string $config, string $entry): string
{
$marker = " 's3' => [";

return Str::replace($marker, "$entry\n\n$marker", $config);
}

private function defaultFtpConfig() : string
private function defaultFtpConfig(): string
{
$c = <<<'CONFIG'
'ftp' => [
Expand All @@ -91,7 +91,7 @@ private function defaultFtpConfig() : string
return $c;
}

private function defaultSftpConfig() : string
private function defaultSftpConfig(): string
{
$c = <<<'CONFIG'
'sftp' => [
Expand Down Expand Up @@ -123,4 +123,4 @@ private function defaultSftpConfig() : string

return $c;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
*/
trait BuildsCreateProjectForm
{
public function buildForm() : CreateProjectForm
public function buildForm(): CreateProjectForm
{
$sailServiceRepository = $this->sailServiceRepository();

Expand Down Expand Up @@ -110,8 +110,8 @@ public function buildForm() : CreateProjectForm
);
}

private function sailServiceRepository() : SailServiceRepository
private function sailServiceRepository(): SailServiceRepository
{
return resolve(SailServiceRepository::class);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ class CreateProjectRequestParameter

/** @see Authentication */
const STARTER = 'starter';
const USES_JETSTREAM_TEAMS = self::USES_PREFIX . 'jetstream-teams';
const USES_JETSTREAM_TEAMS = self::USES_PREFIX.'jetstream-teams';
const JETSTREAM_FRONTEND = 'jetstream-frontend';
const BREEZE_FRONTEND = 'breeze-frontend';
const USES_FORTIFY = self::USES_PREFIX . 'fortify';
const USES_PASSPORT = self::USES_PREFIX . 'passport';
const USES_SOCIALITE = self::USES_PREFIX . 'socialite';
const USES_FORTIFY = self::USES_PREFIX.'fortify';
const USES_PASSPORT = self::USES_PREFIX.'passport';
const USES_SOCIALITE = self::USES_PREFIX.'socialite';

/** @see Database */
const DATABASE = 'database';
Expand All @@ -50,18 +50,18 @@ class CreateProjectRequestParameter

/** @see Queue */
const QUEUE_DRIVER = 'queue';
const USES_HORIZON = self::USES_PREFIX . 'horizon';
const USES_HORIZON = self::USES_PREFIX.'horizon';

/** @see DevelopmentTools */
const USES_TELESCOPE = self::USES_PREFIX . 'telescope';
const USES_MAILHOG = self::USES_PREFIX . 'mailhog';
const USES_ENVOY = self::USES_PREFIX . 'envoy';
const USES_PENNANT = self::USES_PREFIX . 'pennant';
const USES_DEVCONTAINER = self::USES_PREFIX . 'devcontainer';
const USES_TELESCOPE = self::USES_PREFIX.'telescope';
const USES_MAILHOG = self::USES_PREFIX.'mailhog';
const USES_ENVOY = self::USES_PREFIX.'envoy';
const USES_PENNANT = self::USES_PREFIX.'pennant';
const USES_DEVCONTAINER = self::USES_PREFIX.'devcontainer';

/** @see Testing */
const USES_DUSK = self::USES_PREFIX . 'dusk';
const USES_PEST = self::USES_PREFIX . 'pest';
const USES_DUSK = self::USES_PREFIX.'dusk';
const USES_PEST = self::USES_PREFIX.'pest';

/** @see Payment */
const CASHIER_DRIVER = 'cashier';
Expand All @@ -76,11 +76,11 @@ class CreateProjectRequestParameter
const MAIL_DRIVER = 'mail';

/** @see Storage */
const USES_MINIO = self::USES_PREFIX . 'minio';
const USES_FLYSYSTEM_S3_DRIVER = self::USES_PREFIX . 'flysystem-s3';
const USES_FLYSYSTEM_SFTP_DRIVER = self::USES_PREFIX . 'flysystem-sftp';
const USES_FLYSYSTEM_FTP_DRIVER = self::USES_PREFIX . 'flysystem-ftp';
const USES_FLYSYSTEM_READONLY_DRIVER = self::USES_PREFIX . 'flysystem-readonly';
const USES_FLYSYSTEM_SCOPED_DRIVER = self::USES_PREFIX . 'flysystem-scoped';
const USES_DBAL = self::USES_PREFIX . 'dbal';
}
const USES_MINIO = self::USES_PREFIX.'minio';
const USES_FLYSYSTEM_S3_DRIVER = self::USES_PREFIX.'flysystem-s3';
const USES_FLYSYSTEM_SFTP_DRIVER = self::USES_PREFIX.'flysystem-sftp';
const USES_FLYSYSTEM_FTP_DRIVER = self::USES_PREFIX.'flysystem-ftp';
const USES_FLYSYSTEM_READONLY_DRIVER = self::USES_PREFIX.'flysystem-readonly';
const USES_FLYSYSTEM_SCOPED_DRIVER = self::USES_PREFIX.'flysystem-scoped';
const USES_DBAL = self::USES_PREFIX.'dbal';
}
2 changes: 1 addition & 1 deletion domains/CreateProjectForm/Sections/Storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ public function __construct(
public bool $usesReadonly,
) {
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,33 @@

class FtpDriver extends ComposerDependency
{
public function id() : string
public function id(): string
{
return 'flysystem-ftp';
}

public function packageId() : string
public function packageId(): string
{
return 'league/flysystem-ftp';
}

public function name() : string
public function name(): string
{
return 'FTP';
}

public function description() : string
public function description(): string
{
return 'Allows you to manage files using the File Transfer Protocol.';
}

public function href() : ?string
public function href(): ?string
{
return 'https://laravel.com/docs/filesystem#ftp-driver-configuration';
}

public function versionConstraint() : ?string
public function versionConstraint(): ?string
{
return '^3.0';
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,33 @@

class ReadonlyDriver extends ComposerDependency
{
public function id() : string
public function id(): string
{
return 'flysystem-readonly';
}

public function packageId() : string
public function packageId(): string
{
return 'league/flysystem-read-only';
}

public function name() : string
public function name(): string
{
return 'Read-Only';
}

public function description() : string
public function description(): string
{
return 'Allows you to create filesystem disks that do not allow write operations.';
}

public function href() : ?string
public function href(): ?string
{
return 'https://laravel.com/docs/filesystem#scoped-and-read-only-filesystems';
}

public function versionConstraint() : ?string
public function versionConstraint(): ?string
{
return '^3.0';
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,39 +6,39 @@

class S3Driver extends ComposerDependency
{
public function id() : string
public function id(): string
{
return 'flysystem-aws';
}

public function packageId() : string
public function packageId(): string
{
return 'league/flysystem-aws-s3-v3';
}

public function name() : string
public function name(): string
{
return 'Amazon Simple Storage Service (S3)';
}

public function description() : string
public function description(): string
{
// Was inlined to be able to use links.
return '';
}

public function href() : ?string
public function href(): ?string
{
return 'https://aws.amazon.com/s3';
}

public function needsToBeInstalledWithAllDependencies() : bool
public function needsToBeInstalledWithAllDependencies(): bool
{
return true;
}

public function versionConstraint() : ?string
public function versionConstraint(): ?string
{
return '^3.0';
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,33 @@

class ScopedDriver extends ComposerDependency
{
public function id() : string
public function id(): string
{
return 'flysystem-scoped';
}

public function packageId() : string
public function packageId(): string
{
return 'league/flysystem-path-prefixing';
}

public function name() : string
public function name(): string
{
return 'Scoped';
}

public function description() : string
public function description(): string
{
return 'Allows you to define a filesystem where all paths are automatically prefixed with a given path prefix.';
}

public function href() : ?string
public function href(): ?string
{
return 'https://laravel.com/docs/filesystem#scoped-and-read-only-filesystems';
}

public function versionConstraint() : ?string
public function versionConstraint(): ?string
{
return '^3.0';
}
}
}
Loading