Skip to content

Commit

Permalink
Merge pull request #44 from remotelyliving/ci-fixes
Browse files Browse the repository at this point in the history
Ci fixes
  • Loading branch information
Christian Thomas authored Dec 22, 2021
2 parents 1534497 + ee54ba7 commit fa1eebe
Show file tree
Hide file tree
Showing 14 changed files with 22 additions and 44 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/php-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['7.4', '8.1']
php-versions: ['7.4', '8.0']
name: PHP ${{ matrix.php-versions }} Test on Ubuntu
steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ churn-report:
@vendor/bin/churn run

static-analysis:
@vendor/bin/phpstan analyze --level=max ./src && ./vendor/bin/psalm --show-info=false
@vendor/bin/phpstan analyze --level=8 ./src && ./vendor/bin/psalm --show-info=false

style-fix:
@vendor/bin/phpcbf --standard=PSR12 ./src ./tests
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"php-coveralls/php-coveralls": "^2.1",
"symfony/cache": "^4.3",
"vimeo/psalm": "^4.10",
"rector/rector": "^0.11.58",
"rector/rector": "^0.12.8",
"bmitch/churn-php": "^1.5"
},
"autoload": {
Expand Down
29 changes: 0 additions & 29 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,3 @@ parameters:
checkMissingIterableValueType: false
checkGenericClassInNonGenericObjectType: false
ignoreErrors:
-
message: "#^Method RemotelyLiving\\\\PHPDNS\\\\Entities\\\\DNSRecordCollection\\:\\:offsetExists\\(\\) has parameter \\$offset with no typehint specified\\.$#"
count: 1
path: src/Entities/DNSRecordCollection.php

-
message: "#^Method RemotelyLiving\\\\PHPDNS\\\\Entities\\\\DNSRecordCollection\\:\\:offsetGet\\(\\) has parameter \\$offset with no typehint specified\\.$#"
count: 1
path: src/Entities/DNSRecordCollection.php

-
message: "#^Method RemotelyLiving\\\\PHPDNS\\\\Entities\\\\DNSRecordCollection\\:\\:offsetSet\\(\\) has parameter \\$offset with no typehint specified\\.$#"
count: 1
path: src/Entities/DNSRecordCollection.php

-
message: "#^Method RemotelyLiving\\\\PHPDNS\\\\Entities\\\\DNSRecordCollection\\:\\:offsetSet\\(\\) has parameter \\$value with no typehint specified\\.$#"
count: 1
path: src/Entities/DNSRecordCollection.php

-
message: "#^Method RemotelyLiving\\\\PHPDNS\\\\Entities\\\\DNSRecordCollection\\:\\:offsetUnset\\(\\) has parameter \\$offset with no typehint specified\\.$#"
count: 1
path: src/Entities/DNSRecordCollection.php

-
message: "#^Variable \\$record in PHPDoc tag @var does not exist\\.$#"
count: 1
path: src/Entities/DNSRecordCollection.php
8 changes: 4 additions & 4 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Rector\Core\Configuration\Option;
use Rector\Php74\Rector\Property\TypedPropertyRector;
use Rector\Set\ValueObject\SetList;
use Rector\Set\ValueObject\LevelSetList;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;

return static function (ContainerConfigurator $containerConfigurator): void {
Expand All @@ -15,11 +15,11 @@
]);

// Define what rule sets will be applied
$containerConfigurator->import(SetList::DEAD_CODE);
$containerConfigurator->import(LevelSetList::UP_TO_PHP_81);

// get services (needed for register a single rule)
// $services = $containerConfigurator->services();
$services = $containerConfigurator->services();

// register a single rule
// $services->set(TypedPropertyRector::class);
$services->set(TypedPropertyRector::class);
};
1 change: 1 addition & 0 deletions src/Entities/CNAMEData.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public function serialize(): string
*/
public function unserialize($serialized): void
{
/** @var array{'hostname': string} $unserialized */
$unserialized = unserialize($serialized);
$this->hostname = new Hostname($unserialized['hostname']);
}
Expand Down
14 changes: 13 additions & 1 deletion src/Entities/DNSRecordCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,27 @@ public function rewind(): void
$this->records->rewind();
}

/**
* @param mixed $offset
* @return bool
*/
public function offsetExists($offset): bool
{
return $this->records->offsetExists($offset);
}

/**
* @param mixed $offset
* @return \RemotelyLiving\PHPDNS\Entities\Interfaces\DNSRecordInterface
*/
public function offsetGet($offset): DNSRecordInterface
{
return $this->records->offsetGet($offset);
}

/**
* @param mixed $offset
* @param mixed $value
* @throws \RemotelyLiving\PHPDNS\Exceptions\InvalidArgumentException
*/
public function offsetSet($offset, $value): void
Expand All @@ -109,6 +119,9 @@ public function offsetSet($offset, $value): void
$this->records->offsetSet($offset, /** @scrutinizer ignore-type */ $value);
}

/**
* @param mixed $offset
*/
public function offsetUnset($offset): void
{
$this->records->offsetUnset($offset);
Expand Down Expand Up @@ -165,7 +178,6 @@ private function filterValues(callable $eval): self
$filtered = new self();
$records = $this->records->getArrayCopy();

/** @var \RemotelyLiving\PHPDNS\Entities\Interfaces\DNSRecordInterface $record */
while ($record = array_shift($records)) {
if ($eval($record, new self(...$records))) {
$filtered[] = $record;
Expand Down
1 change: 0 additions & 1 deletion src/Entities/EntityAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@

abstract class EntityAbstract
{

}
2 changes: 1 addition & 1 deletion src/Entities/PTRData.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ public function unserialize($serialized): void
$unserialized = unserialize($serialized);
$this->hostname = new Hostname($unserialized['hostname']);
}
}
}
1 change: 0 additions & 1 deletion src/Exceptions/InvalidArgumentException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@

final class InvalidArgumentException extends Exception
{

}
1 change: 0 additions & 1 deletion src/Resolvers/Exceptions/QueryFailure.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@

class QueryFailure extends Exception
{

}
1 change: 0 additions & 1 deletion src/Resolvers/Exceptions/ReverseLookupFailure.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@

final class ReverseLookupFailure extends QueryFailure
{

}
1 change: 0 additions & 1 deletion src/Resolvers/Interfaces/ObservableResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@

interface ObservableResolver extends Resolver, Observable, LoggerAwareInterface
{

}
1 change: 0 additions & 1 deletion tests/Unit/Entities/CAADataTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

class CAADataTest extends BaseTestAbstract
{

private $flags = 0;

private $tag = 'issue';
Expand Down

0 comments on commit fa1eebe

Please sign in to comment.