Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org

root = true

[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 2

[*.{diff,md}]
trim_trailing_whitespace = false

[*.{php,xml,json}]
indent_size = 4
7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ language: php

matrix:
include:
- php: 7.1
env: CHECKS=yes
- php: 7.2
- php: 7.3
env: CHECKS=yes
- php: 7.4
- php: 8.0
- php: 8.1

sudo: false

Expand Down
17 changes: 13 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,29 @@
}
],
"require": {
"php": ">=7.1",
"php": ">=7.3",
"axy/backtrace": "~2.0.0"
},
"require-dev": {
"phpunit/phpunit": "^7.5",
"phpunit/phpunit": "^9.0",
"squizlabs/php_codesniffer": "^3.4",
"phpmd/phpmd": "^2.6"
},
"autoload": {
"psr-4": {
"axy\\errors\\": "src",
"axy\\errors\\tests\\": "tests"
"axy\\errors\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"axy\\errors\\tests\\": "tests/"
}
},
"scripts": {
"test": "phpunit -c phpunit.xml.dist",
"md": "phpmd --exclude vendor . text phpmd.xml.dist",
"cs": "phpcs --standard=PSR2 --encoding=utf-8 --ignore=vendor ."
},
"archive": {
"exclude": ["/tests/*", "/doc/*", "/cs.sh", "/phpmd.sh", "/*.xml.dist", "/CHANGELOG.md"]
}
Expand Down
Empty file modified cs.sh
100755 → 100644
Empty file.
24 changes: 0 additions & 24 deletions index.php

This file was deleted.

3 changes: 1 addition & 2 deletions phpmd.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ args="text phpmd.xml.dist"

if [ "$#" -ne 0 ]; then
${cmd} "$@" ${args}
else
else
${cmd} . ${args}
fi

26 changes: 13 additions & 13 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit backupGlobals="false"
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
backupGlobals="false"
backupStaticAttributes="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
bootstrap="tests/bootstrap.php"
cacheResult="false"
>
<testsuites>
<testsuite name="Base Test Suite">
<directory suffix="Test.php">./tests/</directory>
</testsuite>
</testsuites>

<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./src</directory>
</whitelist>
</filter>
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./src</directory>
</include>
</coverage>
<testsuites>
<testsuite name="Base Test Suite">
<directory suffix="Test.php">./tests/</directory>
</testsuite>
</testsuites>
</phpunit>

2 changes: 1 addition & 1 deletion src/ContainerReadOnly.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
* @link https://github.com/axypro/errors/blob/master/doc/classes/ContainerReadOnly.md documentation
*/
class ContainerReadOnly extends Logic implements ReadOnly
class ContainerReadOnly extends Logic implements ReadOnlyException
{
/**
* {@inheritdoc}
Expand Down
2 changes: 1 addition & 1 deletion src/PropertyReadOnly.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
* @link https://github.com/axypro/errors/blob/master/doc/classes/PropertyReadOnly.md documentation
*/
class PropertyReadOnly extends Logic implements ReadOnly
class PropertyReadOnly extends Logic implements ReadOnlyException
{
/**
* {@inheritdoc}
Expand Down
2 changes: 1 addition & 1 deletion src/ReadOnly.php → src/ReadOnlyException.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
*
* @link https://github.com/axypro/errors/blob/master/doc/errors.md documentation
*/
interface ReadOnly extends Forbidden
interface ReadOnlyException extends Forbidden
{
}
2 changes: 1 addition & 1 deletion tests/ContainerReadOnlyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function testCreate(): void
$this->assertInstanceOf('axy\errors\Error', $e);
$this->assertInstanceOf('axy\errors\Logic', $e);
$this->assertInstanceOf('axy\errors\Forbidden', $e);
$this->assertInstanceOf('axy\errors\ReadOnly', $e);
$this->assertInstanceOf('axy\errors\ReadOnlyException', $e);
$this->assertSame('Cont', $e->getContainer());
$this->assertSame($previous, $e->getPrevious());
$this->assertSame('Cont is read-only', $e->getMessage());
Expand Down
2 changes: 1 addition & 1 deletion tests/PropertyReadOnlyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function testCreate(): void
$this->assertInstanceOf('axy\errors\Error', $e);
$this->assertInstanceOf('axy\errors\Logic', $e);
$this->assertInstanceOf('axy\errors\Forbidden', $e);
$this->assertInstanceOf('axy\errors\ReadOnly', $e);
$this->assertInstanceOf('axy\errors\ReadOnlyException', $e);
$this->assertSame('Cont', $e->getContainer());
$this->assertSame('prop', $e->getKey());
$this->assertSame($previous, $e->getPrevious());
Expand Down
11 changes: 0 additions & 11 deletions tests/bootstrap.php

This file was deleted.

Empty file modified unit.sh
100755 → 100644
Empty file.