Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
b84f3b0
fix: correct object
jpswade Dec 31, 2019
0b58663
fix: simple xml is required
jpswade Dec 31, 2019
68b1114
fix: correct objects
jpswade Dec 31, 2019
996d96a
fix: correct var
jpswade Dec 31, 2019
efaf68d
fix: Command syntax error: error at line 5: Element '{urn:ietf:para…
jpswade Dec 31, 2019
ec28f8c
fix: not an abstract
jpswade Dec 31, 2019
8f5b49d
fix: let's default to int and hint some objects
jpswade Dec 31, 2019
783b516
fix: correct response
jpswade Dec 31, 2019
b631e59
fix: cleanup
jpswade Dec 31, 2019
1ad1c21
fix: add return and throws
jpswade Dec 31, 2019
11fa712
fix: this isn't a requirement
jpswade Jan 1, 2020
d8e5172
fix: restore the lookup method
jpswade Jan 1, 2020
0cf721f
fix: corrections
jpswade Jan 1, 2020
aa8543d
fix: reconfigure domain
jpswade Jan 1, 2020
bec911a
fix: types
jpswade Jan 1, 2020
5ca1817
fix: SimpleXMLElement::addAttribute(): Attribute requires prefix for …
jpswade Jan 1, 2020
89d68f6
fix: add namespace
jpswade Jan 1, 2020
43bf643
fix: rm ns
jpswade Jan 1, 2020
2756f34
fix: let's just not include this for now...
jpswade Jan 1, 2020
57ad4ef
fix: Command syntax error: error at line 5: Element '{urn:ietf:params…
jpswade Jan 1, 2020
cdb3e97
fix: complete the deleted domain logic
jpswade Jan 27, 2021
aa20ce9
fix: correct domain object
jpswade Jan 27, 2021
f1d7475
fix: update everything to latest
jpswade Jan 27, 2021
90da8f1
fix: correct namespace/paths
jpswade Jan 27, 2021
515b103
fix: upgrade to psr-4
jpswade Jan 27, 2021
6eef332
fix: upgrade phpunit, fix the tests
jpswade Jan 27, 2021
e38ca5e
fix: correct test
jpswade Jan 27, 2021
389eb51
fix: break out login xml to a file so we can use that to compare
jpswade Jan 27, 2021
7e33ddc
fix: make the test pass
jpswade Jan 27, 2021
7e553ce
fix: ignore
jpswade Jan 27, 2021
d7917ed
fix: correct the xml to be as expected
jpswade Jan 27, 2021
eebf391
fix: correct the test, so we always get the expected format
jpswade Jan 27, 2021
b88a99c
fix: use atom to format the time
jpswade Jan 27, 2021
3078f93
fix: make the request work
jpswade Jan 27, 2021
f186e54
fix: make the response work
jpswade Jan 27, 2021
cae3940
fix: upgrade phpunit again
jpswade Jan 27, 2021
19a5954
fix: update phpunit again
jpswade Jan 27, 2021
e48fe74
fix: update phpmd and phpcs
jpswade Jan 27, 2021
ae1dd0d
fix: run phpcbf
jpswade Jan 27, 2021
833e347
fix: improve how we handle exceptions
jpswade Jan 27, 2021
4afe516
fix: cleanup, modernise and improve interfacing for renewals, allows …
jpswade Sep 5, 2021
ee2f184
fix: if we have a domain set it
jpswade Sep 5, 2021
01d6ef9
fix: must be a valid date format, also allow unit to be changed
jpswade Sep 5, 2021
a3eebe0
fix: broken code, use setters instead of setting protected attributes
jpswade Sep 5, 2021
90bea19
fix: date is required!
jpswade Sep 5, 2021
2d5546a
fix: add a test for renew object
jpswade Sep 5, 2021
72409cc
fix: abstract getting logic away into method
jpswade Sep 5, 2021
19a727a
fix: new line
jpswade Sep 5, 2021
0bcb80c
fix: include the message in the exception for easier debugging
jpswade Sep 5, 2021
1824eb5
fix: handle roid on host + cleanup
jpswade Nov 22, 2021
c19c914
fix: cleanup, correct types, correct/add validation
jpswade Sep 10, 2022
5260bde
fix: can be an object or int
jpswade Sep 10, 2022
b5122c8
fix: correct checks and tests, break out test data
jpswade Sep 10, 2022
1632434
fix: if bill is empty ignore
jpswade Sep 10, 2022
9041ca4
fix: add test
jpswade Sep 10, 2022
b2f354b
fix: add failing test
jpswade Sep 10, 2022
ebccc84
fix: cleanup
jpswade Sep 11, 2022
751b24b
fix: make test pass
jpswade Sep 11, 2022
aabc380
fix: add a way to add the request to the object, fix warnings
jpswade Sep 11, 2022
ff83939
fix: abstract abstract request response
jpswade Sep 11, 2022
276a9c5
fix: handle no notes
jpswade Sep 11, 2022
2e13716
fix: add namespace
jpswade Sep 11, 2022
b1867a8
fix: ns': Missing child element(s)
jpswade Sep 11, 2022
9c6c955
fix: ns': Missing child element(s)
jpswade Sep 11, 2022
f1da9e9
fix: ensure we have a hostname/nameserver
jpswade Sep 11, 2022
c2d4d84
fix: correct check
jpswade Sep 11, 2022
59a5a2d
fix: make tests pass
jpswade Sep 11, 2022
c6d67aa
fix: add to string
jpswade Sep 11, 2022
c0ac059
fix: abstract the update request builder
jpswade Sep 11, 2022
676f2a7
fix: make the updater actually work
jpswade Sep 11, 2022
a4fa6f9
fix: make test pass again
jpswade Sep 11, 2022
eddc76f
fix: type hint
jpswade Sep 11, 2022
aa620b8
fix: add to string and to array for domains to help with debugging
jpswade Sep 11, 2022
8b0af0b
fix: convert to new type
jpswade Sep 11, 2022
13aa52e
fix: typo
jpswade Sep 11, 2022
a400b61
fix: all of these can be null
jpswade Sep 11, 2022
e8f2e57
fix: make more oopy
jpswade Sep 11, 2022
39ed1ec
fix: clean
jpswade Sep 11, 2022
bcf205a
fix: to array for debugging
jpswade Sep 11, 2022
3832d07
fix: allow passable current domain
jpswade Sep 11, 2022
4360b5c
fix: Command syntax error: error at line 11: Element '{urn:ietf:param…
jpswade Sep 11, 2022
882d400
fix: simplify logic
jpswade Sep 11, 2022
f2f0dbe
fix: can be null
jpswade Sep 12, 2022
5a784fd
fix: cleanup, centralise valid xml logic, fix types/static issues, up…
jpswade Sep 12, 2022
8240a9c
fix: cleanup, fix issue with data
jpswade Sep 12, 2022
b644d9d
fix: make sure tests pass
jpswade Sep 12, 2022
52c9225
fix: cleanup + validation
jpswade Sep 12, 2022
8595be3
fix: cleanup + validation
jpswade Sep 12, 2022
7c0799d
fix: correct typing, plus cleanup
jpswade Sep 12, 2022
ed6a760
fix: must be compatible
jpswade Sep 12, 2022
66cd754
fix: tidy + centralise upDate logic
jpswade Sep 12, 2022
2a59b22
fix: compat
jpswade Sep 12, 2022
43e820c
fix: HostName parameter "ns1.example.com." is not the fully qualified…
jpswade Sep 12, 2022
c13b930
fix: at the point of building the xml, remove the trailing dot
jpswade Sep 12, 2022
1341eda
fix: add test for error
jpswade Sep 13, 2022
3b5c43d
fix: update namespace version
jpswade Sep 13, 2022
6a1258e
fix: registrant must not be accessed before initialization
jpswade Sep 13, 2022
2e41c52
fix: cleanup
jpswade Sep 13, 2022
e6ca8da
fix: add nulls
jpswade Sep 13, 2022
8a21ade
fix: may be null
jpswade Sep 14, 2022
9f086a6
fix: $id must not be accessed before initialization
jpswade Sep 14, 2022
23736bf
fix: return datetime
jpswade Sep 14, 2022
593c063
fix: rm debug
jpswade Sep 14, 2022
cfb68a5
fix: rm
jpswade Sep 14, 2022
a9ee32b
fix: must be compatible
jpswade Sep 27, 2025
b1961ff
fix: update
jpswade Sep 27, 2025
d07f441
fix: phpcbf
jpswade Sep 27, 2025
d0e0d54
fix: more versions
jpswade Sep 27, 2025
c598b9e
fix: improve comparison
jpswade Sep 27, 2025
b4c8bc3
fix: modernize
jpswade Sep 27, 2025
3c9e281
fix: further type checking and handling
jpswade Sep 28, 2025
d8ecd01
fix: further cs tweaks
jpswade Sep 28, 2025
f169ff3
fix: further cs tweaks
jpswade Sep 28, 2025
bc9e27f
Merge remote-tracking branch 'origin/master'
jpswade Sep 28, 2025
ed530fe
fix: Typed property SclNominetEpp\Response::$code must not be accesse…
jpswade Sep 28, 2025
df8feae
fix: correct response
jpswade Sep 28, 2025
1e0271a
fix: make greeting work as expected
jpswade Sep 28, 2025
c40c825
fix: tidy up interface
jpswade Oct 13, 2025
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/.idea
/.history
composer.phar
composer.lock
vendor
Expand All @@ -9,3 +11,4 @@ php-cs-fixer.phar
.project
.settings
build
/.phpunit.result.cache
7 changes: 5 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
language: php

php:
- 5.3
- 5.4
- 7.4
- 8.0
- 8.1
- 8.2
- 8.3

before_script:
- composer self-update
Expand Down
44 changes: 34 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,53 @@
{
"name": "Tom Oram",
"email": "[email protected]",
"homepage": "http://github.com/tomphp"
"homepage": "https://github.com/tomphp"
},
{
"name": "Merlyn Cooper",
"email": "[email protected]",
"homepage": "http://github.com/Merlyn-Cooper"
"homepage": "https://github.com/Merlyn-Cooper"
},
{
"name": "James Wade",
"email": "[email protected]",
"homepage": "https://github.com/jpswade"
}
],
"require": {
"php": ">=5.3.0",
"php": ">=7.4",
"sclinternet/scl-contact": "dev-master",
"sclinternet/scl-socket": "dev-master",
"sclinternet/scl-request-response": "dev-master"
"sclinternet/scl-request-response": "dev-master",
"ext-simplexml": "*",
"ext-xmlwriter": "*",
"ext-dom": "*"
},
"autoload": {
"psr-0": {
"SclNominetEpp\\": "src/"
"psr-4": {
"SclNominetEpp\\": "src/SclNominetEpp/"
}
},
"require-dev": {
"phpunit/phpunit" : "3.7.*",
"squizlabs/php_codesniffer" : "1.*",
"phpmd/phpmd" : "1.4.0",
"satooshi/php-coveralls": "dev-master"
"phpunit/phpunit" : "8.*",
"squizlabs/php_codesniffer" : "3.*",
"phpmd/phpmd" : "2.*"
},
"scripts": {
"test": "phpunit",
"test-coverage": "phpunit --coverage-html coverage",
"cs": "phpcs --standard=phpcs.xml",
"cs-fix": "phpcbf --standard=phpcs.xml",
"cs-check": "phpcs --standard=phpcs.xml --report=summary",
"phpmd": "phpmd src text cleancode,codesize,controversial,design,naming,unusedcode",
"quality": [
"@cs-check",
"@phpmd",
"@test"
],
"quality-fix": [
"@cs-fix",
"@test"
]
}
}
89 changes: 89 additions & 0 deletions phpcs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<?xml version="1.0"?>
<ruleset name="SclNominetEpp">
<description>Coding standard for SclNominetEpp library</description>

<!-- Include the entire src directory -->
<file>src</file>

<!-- Include the entire tests directory -->
<file>tests</file>

<!-- Exclude vendor directory -->
<exclude-pattern>vendor</exclude-pattern>

<!-- Exclude cache files -->
<exclude-pattern>*.cache</exclude-pattern>
<exclude-pattern>.phpunit.result.cache</exclude-pattern>

<!-- Use PSR-12 as the base standard -->
<rule ref="PSR12"/>

<!-- Additional rules for better code quality -->
<rule ref="Generic.Files.LineLength">
<properties>
<property name="lineLimit" value="120"/>
<property name="absoluteLineLimit" value="150"/>
</properties>
</rule>

<!-- Disable line length restrictions for test files -->
<rule ref="Generic.Files.LineLength">
<severity>0</severity>
</rule>

<!-- Enforce consistent naming -->
<rule ref="PSR1.Classes.ClassDeclaration"/>
<rule ref="PSR1.Methods.CamelCapsMethodName"/>

<!-- Documentation rules - practical approach for source files -->
<rule ref="Squiz.Commenting.FunctionComment">
<severity>5</severity>
<!-- Disable redundant @return tag when return type is already declared -->
<exclude name="Squiz.Commenting.FunctionComment.MissingReturn"/>
<!-- Disable parameter comment requirements when type hints are present -->
<exclude name="Squiz.Commenting.FunctionComment.MissingParamComment"/>
<!-- Allow shorter parameter descriptions -->
<exclude name="Squiz.Commenting.FunctionComment.ParamNameNoMatch"/>
<!-- Disable missing function comment requirement - too strict for all methods -->
<exclude name="Squiz.Commenting.FunctionComment.Missing"/>
</rule>

<!-- Class documentation - only require for public classes -->
<rule ref="Squiz.Commenting.ClassComment">
<severity>5</severity>
<!-- Only require for public classes -->
<exclude name="Squiz.Commenting.ClassComment.Missing"/>
</rule>

<!-- Disable all documentation requirements for test files -->
<rule ref="Squiz.Commenting.FunctionComment">
<severity>0</severity>
</rule>
<rule ref="Squiz.Commenting.ClassComment">
<severity>0</severity>
</rule>

<!-- Security rules -->
<rule ref="Generic.PHP.DeprecatedFunctions"/>
<rule ref="Generic.PHP.ForbiddenFunctions"/>

<!-- Code quality rules -->
<rule ref="Generic.CodeAnalysis.EmptyStatement"/>
<rule ref="Generic.CodeAnalysis.UnconditionalIfStatement"/>
<rule ref="Generic.CodeAnalysis.UnnecessaryFinalModifier"/>

<!-- Disable some overly strict rules -->
<rule ref="PSR12.Classes.ClassInstantiation">
<severity>0</severity>
</rule>

<!-- Allow short array syntax -->
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>

<!-- Show progress -->
<arg name="colors"/>

<!-- Generate reports -->
<arg value="sp"/>
<arg value="np"/>
</ruleset>
2 changes: 1 addition & 1 deletion phpunit.xml.dist → phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0"?>
<phpunit
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
Expand All @@ -8,7 +9,6 @@
stopOnFailure="false"
processIsolation="false"
backupGlobals="false"
syntaxCheck="true"
>
<testsuite name="UnitTests">
<directory>./tests</directory>
Expand Down
37 changes: 37 additions & 0 deletions src/SclNominetEpp/AbstractRequestResponse.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php

namespace SclNominetEpp;

use SclRequestResponse\AbstractRequestResponse as BaseAbstractRequestResponse;
use SclRequestResponse\RequestInterface;
use SclRequestResponse\ResponseInterface;

abstract class AbstractRequestResponse extends BaseAbstractRequestResponse
{
/**
* The stored request object.
*/
private RequestInterface $request;

/**
* Process a request and store it for later retrieval.
*
* @param RequestInterface $request The request to process.
* @return ResponseInterface The result of processing the request
*/
public function processRequest(RequestInterface $request): ResponseInterface
{
$this->request = $request;
return parent::processRequest($request);
}

/**
* Get the currently stored request.
*
* @return RequestInterface The stored request
*/
public function getRequest(): RequestInterface
{
return $this->request;
}
}
13 changes: 8 additions & 5 deletions src/SclNominetEpp/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@
namespace SclNominetEpp;

/**
* DocBlock: Description of Address
* @author Merlyn Cooper <[email protected]>
* Address class for handling address information.
*/
class Address extends \SclContact\Address
{


public function setLines(array $lines)
/**
* Set address lines from array.
*
* @param array $lines The address lines.
* @return void
*/
public function setLines(array $lines): void
{
if (count($lines) === 3) {
$this->setLine1($lines[0] . ', ' . $lines[1]);
Expand Down
50 changes: 26 additions & 24 deletions src/SclNominetEpp/Communicator.php
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
<?php

/**
* Contains the Communicator class definition.
*
* @author Tom Oram <[email protected]>
*/

namespace SclNominetEpp;

use SclRequestResponse\Exception\ConnectionFailedException;
use SclSocket\SocketInterface;
use SclRequestResponse\Communicator\PersistentCommunicator;

/**
* Sets up communication with the Nominet EPP server and sends requests and
* processes the responses.
*
* @author Tom Oram
*/
class Communicator extends PersistentCommunicator
{
Expand All @@ -23,33 +21,34 @@ class Communicator extends PersistentCommunicator
*
* @var array
*/
public static $config = array(
'live' => array(
'secure' => array(
public static array $config = [
'live' => [
'secure' => [
'host' => 'epp.nominet.org.uk',
'port' => '700',
),
'insecure' => array(
],
'insecure' => [
'host' => 'epp.nominet.org.uk',
'port' => '8700',
),
),
'test' => array(
'secure' => array(
],
],
'test' => [
'secure' => [
'host' => 'testbed-epp.nominet.org.uk',
'port' => '700',
),
'insecure' => array(
],
'insecure' => [
'host' => 'testbed-epp.nominet.org.uk',
'port' => '8700',
),
),
);
],
],
];

/**
* Constructor
*
* @param SocketInterface $socket
* @param SocketInterface $socket The socket interface.
* @return void
*/
public function __construct(SocketInterface $socket)
{
Expand All @@ -59,12 +58,13 @@ public function __construct(SocketInterface $socket)
/**
* Connect to the server.
*
* @param boolean $live
* @param boolean $secure
* @param boolean $live Whether to use live or test environment.
* @param boolean $secure Whether to use secure connection.
*
* @return void
* @throws ConnectionFailedException When connection setup fails.
*/
public function setupConnection($live = false, $secure = true)
public function setupConnection(bool $live = false, bool $secure = true): void
{
$liveIndex = $live ? 'live' : 'test';
$secureIndex = $secure ? 'secure' : 'insecure';
Expand All @@ -73,7 +73,9 @@ public function setupConnection($live = false, $secure = true)

$this->connect($config['host'], $config['port'], $secure);

// TODO Parse and verify the greeting.
$this->read();
$response = $this->read();
if (empty($response)) {
throw new ConnectionFailedException('No greeting received from server.');
}
}
}
Loading