Skip to content
This repository has been archived by the owner on Jan 9, 2025. It is now read-only.

Commit

Permalink
Fixed PHPCS
Browse files Browse the repository at this point in the history
  • Loading branch information
CommandString authored Jul 10, 2023
1 parent 9a188c0 commit ea5be41
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
6 changes: 2 additions & 4 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
// A single space or none should be between cast and variable.
'cast_spaces' => false,
// Class, trait and interface elements must be separated with one or none blank line.
'class_attributes_separation' => ['elements' => ['const' => 'one', 'method' => 'one', 'property' => 'one', 'trait_import' => 'none']],
'class_attributes_separation' => ['elements' => ['const' => 'none', 'method' => 'one', 'property' => 'none', 'trait_import' => 'none']],
// Whitespace around the keywords of a class, trait, enum or interfaces definition should be one space.
'class_definition' => ['multi_line_extends_each_single_line' => true, 'single_item_single_line' => true, 'single_line' => true],
// Namespace must not contain spacing, comments or PHPDoc.
'clean_namespace' => true,
// Remove extra spaces in a nullable typehint.
'compact_nullable_typehint' => true,
// Concatenation should be spaced according to configuration.
'concat_space' => ['spacing' => 'none'],
'concat_space' => ['spacing' => 'one'],
// The PHP constants `true`, `false`, and `null` MUST be written using the correct casing.
'constant_case' => ['case' => 'lower'],
// The body of each control structure MUST be enclosed within braces.
Expand Down Expand Up @@ -208,8 +208,6 @@
'short_scalar_cast' => true,
// A PHP file without end tag must always end with a single empty line feed.
'single_blank_line_at_eof' => true,
// There should be exactly one blank line before a namespace declaration.
'single_blank_line_before_namespace' => true,
// There MUST NOT be more than one property or constant declared per statement.
'single_class_element_per_statement' => ['elements' => ['const', 'property']],
// There MUST be one use keyword per declaration.
Expand Down
10 changes: 5 additions & 5 deletions src/Setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ private static function getComposerJsonData(string $packageName): array
'description' => self::prompt('Description'),
'type' => self::prompt('Type', '/^[a-z0-9-]+$/', 'Type must be a valid composer package type', 'library'),
'license' => self::prompt('License', '/^[a-zA-Z0-9\-.+]+$/', 'License must be a valid SPDX identifier', 'MIT'),
'require' => ['php' => '>='.self::prompt('Minimum PHP version', '/^\d+\.\d+$/', 'PHP version must be in the format x.y', '8.2')],
'require' => ['php' => '>=' . self::prompt('Minimum PHP version', '/^\d+\.\d+$/', 'PHP version must be in the format x.y', '8.2')],
'authors' => [],
];
}
Expand Down Expand Up @@ -94,10 +94,10 @@ private static function getAuthorEmail(): string
private static function setAutoloadPaths(array &$composerJsonData, string $vendor, string $package)
{
$composerJsonData['autoload']['psr-4'] = [
$vendor.'\\'.$package.'\\' => 'src/',
$vendor . '\\' . $package . '\\' => 'src/',
];
$composerJsonData['autoload-dev']['psr-4'] = [
$vendor.'\\'.$package.'\\Test\\' => 'tests/',
$vendor . '\\' . $package . '\\Test\\' => 'tests/',
];
}

Expand All @@ -117,7 +117,7 @@ private static function writeComposerJson(array $composerJsonData)
private static function prompt(string $question, ?string $regex = null, ?string $errorMessage = null, ?string $default = null, bool $optional = false): string
{
while (true) {
echo $question.($default ? " [{$default}]" : '').': ';
echo $question . ($default ? " [{$default}]" : '') . ': ';
$input = trim(fgets(STDIN));

if (empty($input)) {
Expand All @@ -143,7 +143,7 @@ private static function prompt(string $question, ?string $regex = null, ?string
*/
private static function error(string $errorMessage)
{
echo $errorMessage."\n";
echo $errorMessage . "\n";
}

public static function unlink()
Expand Down

0 comments on commit ea5be41

Please sign in to comment.