Skip to content

Commit

Permalink
Updated Coding Style implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
Toflar committed Nov 9, 2023
1 parent c796c02 commit 2b7b625
Show file tree
Hide file tree
Showing 20 changed files with 201 additions and 297 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,23 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
php-version: 8.1
coverage: none
tools: php-cs-fixer

- name: Checkout
uses: actions/checkout@v2

- name: Run the CS fixer
run: php-cs-fixer fix
run: composer cs

tests:
name: PHP ${{ matrix.php }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [7.4, 8.0, 8.1, 8.2]
php: [8.1, 8.2]
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down
48 changes: 0 additions & 48 deletions .php-cs-fixer.dist.php

This file was deleted.

6 changes: 5 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"symfony/dom-crawler": "^5.4 || ^6.0",
"symfony/event-dispatcher": "^5.4 || ^6.0",
"symfony/http-client": "^5.4 || ^6.0",
"terminal42/contao-build-tools": "@dev",
"webignition/robots-txt-file": "^3.0"
},
"require-dev": {
Expand All @@ -37,7 +38,10 @@
"preferred-install": {
"*": "dist"
},
"sort-packages": true
"sort-packages": true,
"allow-plugins": {
"terminal42/contao-build-tools": true
}
},
"autoload": {
"psr-4": {
Expand Down
63 changes: 0 additions & 63 deletions phpinsights.php

This file was deleted.

6 changes: 0 additions & 6 deletions src/BaseUriCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,11 @@ public function all(): array
return array_values($this->baseUris);
}

/**
* {@inheritdoc}
*/
public function getIterator(): \Traversable
{
return new \ArrayIterator($this->all());
}

/**
* {@inheritdoc}
*/
public function count(): int
{
return \count($this->all());
Expand Down
14 changes: 6 additions & 8 deletions src/CrawlUri.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ final class CrawlUri
/**
* @var UriInterface|null
*/
private $foundOn = null;
private $foundOn;

/**
* @var array
*/
private $tags = [];

public function __construct(UriInterface $uri, int $level, bool $processed = false, ?UriInterface $foundOn = null)
public function __construct(UriInterface $uri, int $level, bool $processed = false, UriInterface|null $foundOn = null)
{
$this->uri = self::normalizeUri($uri);
$this->level = $level;
Expand All @@ -64,7 +64,7 @@ public function __toString(): string
$this->getLevel(),
$this->isProcessed() ? 'yes' : 'no',
(string) ($this->getFoundOn() ?: 'root'),
$this->getTags() ? implode(', ', $this->getTags()) : 'none'
$this->getTags() ? implode(', ', $this->getTags()) : 'none',
);
}

Expand Down Expand Up @@ -96,7 +96,7 @@ public function wasMarkedProcessed(): bool
return $this->wasMarkedProcessed;
}

public function getFoundOn(): ?UriInterface
public function getFoundOn(): UriInterface|null
{
return $this->foundOn;
}
Expand All @@ -108,7 +108,7 @@ public function getTags(): array

public function addTag(string $tag): self
{
if (false !== strpos($tag, ',')) {
if (str_contains($tag, ',')) {
throw new \InvalidArgumentException('Cannot use commas in tags.');
}

Expand Down Expand Up @@ -139,8 +139,6 @@ public static function normalizeUri(UriInterface $uri): UriInterface
$uri = $uri->withPath('/');
}

$uri = $uri->withFragment('');

return $uri;
return $uri->withFragment('');
}
}
Loading

0 comments on commit 2b7b625

Please sign in to comment.