Skip to content

Commit

Permalink
Revert visibility for certain concept exercises
Browse files Browse the repository at this point in the history
- Revert adding visibility
- Exclude those exercises from PHPCS rule
  • Loading branch information
mk-mxp committed Dec 6, 2023
1 parent cc97047 commit 8eb0ed0
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 13 deletions.
8 changes: 4 additions & 4 deletions exercises/concept/city-office/.meta/exemplar/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@

class Form
{
public function blanks(int $length): string
function blanks(int $length): string
{
return str_repeat(" ", $length);
}

public function letters(string $word): array
function letters(string $word): array
{
return mb_str_split($word);
}

public function checkLength(string $word, int $max_length): bool
function checkLength(string $word, int $max_length): bool
{
$difference = mb_strlen($word) - $max_length;
return $difference <= 0;
}

public function formatAddress(Address $address): string
function formatAddress(Address $address): string
{
$formatted_street = mb_strtoupper($address->street);
$formatted_postal_code = mb_strtoupper($address->postal_code);
Expand Down
8 changes: 4 additions & 4 deletions exercises/concept/city-office/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@

class Form
{
public function blanks($length)
function blanks($length)
{
return str_repeat(" ", $length);
}

public function letters($word)
function letters($word)
{
return mb_str_split($word);
}

public function checkLength($word, $max_length)
function checkLength($word, $max_length)
{
$difference = mb_strlen($word) - $max_length;
return $difference <= 0;
}

public function formatAddress($address)
function formatAddress($address)
{
$formatted_street = mb_strtoupper($address->street);
$formatted_postal_code = mb_strtoupper($address->postal_code);
Expand Down
10 changes: 5 additions & 5 deletions exercises/concept/windowing-system/.meta/exemplar.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@ class ProgramWindow
public $height;
public $width;

public function __construct()
function __construct()
{
$this->y = 0;
$this->x = 0;
$this->height = 600;
$this->width = 800;
}

public function move(Position $position)
function move(Position $position)
{
$this->y = $position->y;
$this->x = $position->x;
}

public function resize(Size $size)
function resize(Size $size)
{
$this->height = $size->height;
$this->width = $size->width;
Expand All @@ -33,7 +33,7 @@ class Position
public $y;
public $x;

public function __construct($y, $x)
function __construct($y, $x)
{
$this->y = $y;
$this->x = $x;
Expand All @@ -45,7 +45,7 @@ class Size
public $height;
public $width;

public function __construct($height, $width)
function __construct($height, $width)
{
$this->height = $height;
$this->width = $width;
Expand Down
19 changes: 19 additions & 0 deletions phpcs-php.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,21 @@
>
<description>Coding standard for Exercism PHP exercises</description>

<!-- Expect all files are UTF-8 -->
<arg name="encoding" value="utf-8" />

<!-- No warnings (ignore them) -->
<arg value="n" />

<!-- Show sniffs (it's easy to find solutions knowing the code) -->
<arg value="s" />

<!-- A TAB is 4 chars wide (does not replace them, for calculation only!) -->
<arg name="tab-width" value="4" />

<!-- Run on 10 files in parallel -->
<arg name="parallel" value="10" />

<file>exercises</file>
<file>src</file>

Expand All @@ -15,6 +30,10 @@
<exclude name="PSR1.Classes.ClassDeclaration.MultipleClasses" />
<exclude name="PSR1.Files.SideEffects.FoundWithSymbols" />
</rule>
<rule ref="Squiz.Scope.MethodScope.Missing">
<exclude-pattern>*/concept/city-office/*</exclude-pattern>
<exclude-pattern>*/concept/windowing-system/*</exclude-pattern>
</rule>
<rule ref="vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/DeclareStrictTypesSniff.php">
<exclude-pattern>*/exemplar\.php</exclude-pattern>
<exclude-pattern>*/concept/*</exclude-pattern>
Expand Down

0 comments on commit 8eb0ed0

Please sign in to comment.