Skip to content

Commit

Permalink
Issue/589 psr 12 compliance in chess variant capablanca (chesslablab#644
Browse files Browse the repository at this point in the history
)

* Opening brace should be on a new line

* Expected 0 spaces after opening bracket; newline found

* Expected at least 1 space before .; 0 found

* Expected 0 spaces after opening bracket; newline found
  • Loading branch information
programarivm authored Oct 21, 2024
1 parent e97f59a commit fd1952c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/Variant/Capablanca/Board.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ class Board extends AbstractBoard
{
const VARIANT = VariantType::CAPABLANCA;

public function __construct(array $pieces = null, string $castlingAbility = '-') {
public function __construct(array $pieces = null, string $castlingAbility = '-')
{
$this->color = new Color();
$this->castlingRule = new CastlingRule();
$this->square = new Square();
Expand Down
3 changes: 1 addition & 2 deletions src/Variant/Capablanca/FEN/PiecePlacement.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ public function validate(string $value): string
{
$fields = explode('/', $value);

if (
$this->eightFields($fields) &&
if ($this->eightFields($fields) &&
$this->kings($fields) &&
$this->validChars($fields)
) {
Expand Down
2 changes: 1 addition & 1 deletion src/Variant/Capablanca/PGN/Move.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function extractSqs(string $string): string

public function explodeSqs(string $string): array
{
preg_match_all('/'.Square::REGEX.'/', $string, $matches);
preg_match_all('/' . Square::REGEX . '/', $string, $matches);

return $matches[0];
}
Expand Down
3 changes: 1 addition & 2 deletions src/Variant/Capablanca/Piece/CapablancaTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ public function moveSqs(): array
foreach ($this->mobility as $key => $val) {
if ($key !== 4) {
foreach ($val as $sq) {
if (
!in_array($sq, $this->board->sqCount['used'][$this->color]) &&
if (!in_array($sq, $this->board->sqCount['used'][$this->color]) &&
!in_array($sq, $this->board->sqCount['used'][$this->oppColor()])
) {
$sqs[] = $sq;
Expand Down

0 comments on commit fd1952c

Please sign in to comment.