Skip to content
This repository has been archived by the owner on Oct 19, 2021. It is now read-only.

Commit

Permalink
Update codesniffer for composer 2.0. (#93)
Browse files Browse the repository at this point in the history
* Update codesniffer so builds pass.

* Update formatting/comments to pass new codesniffer.

* I like my TODO format better.

* Force XDEBUG_MODE to coverage.
  • Loading branch information
swichers committed Dec 28, 2020
1 parent 3ea3849 commit 84ec385
Show file tree
Hide file tree
Showing 38 changed files with 214 additions and 171 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ install:

script:
- php vendor/bin/phpcs
- php vendor/bin/phpunit --coverage-clover ./build/logs/clover.xml
- XDEBUG_MODE=coverage ./vendor/bin/phpunit --coverage-clover ./build/logs/clover.xml

after_script:
- php vendor/bin/codacycoverage clover ./build/logs/clover.xml
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
"symfony/dotenv": "^4.4"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.5.0 || ^0.6.0",
"drupal/coder": "^8.3",
"phpunit/phpunit": "^8.5 || ^6.5"
"phpunit/phpunit": "^8.5 || ^6.5",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.1"
},
"config": {
"platform": {
Expand Down
123 changes: 93 additions & 30 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

<rule ref="Drupal">
<exclude name="Drupal.WhiteSpace.OpenTagNewline.BlankLine"/>
<exclude name="Drupal.Commenting.TodoComment.TodoFormat"/>
<exclude name="Drupal.Commenting.Deprecated"/>
</rule>
<rule ref="DrupalPractice" />
Expand Down
3 changes: 1 addition & 2 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace swichers\Acsf\Client;

use Exception;
use swichers\Acsf\Client\Discovery\ActionManagerInterface;
use swichers\Acsf\Client\Discovery\EntityManagerInterface;
use swichers\Acsf\Client\Endpoints\Action\ActionInterface;
Expand Down Expand Up @@ -214,7 +213,7 @@ public function testConnection($throwException = FALSE): bool {
throw $x;
}
}
catch (Exception $x) {
catch (\Exception $x) {
if ($throwException) {
throw $x;
}
Expand Down
2 changes: 1 addition & 1 deletion src/ClientInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use swichers\Acsf\Client\Endpoints\Entity\EntityInterface;

/**
* Interface ClientInterface.
* Contract for Clients.
*/
interface ClientInterface {

Expand Down
2 changes: 1 addition & 1 deletion src/Discovery/ActionManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace swichers\Acsf\Client\Discovery;

/**
* Class ActionManager.
* Manages Action endpoints.
*/
class ActionManager extends Manager implements ActionManagerInterface {

Expand Down
2 changes: 1 addition & 1 deletion src/Discovery/ActionManagerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace swichers\Acsf\Client\Discovery;

/**
* Interface ActionManagerInterface.
* Contract for action managers.
*/
interface ActionManagerInterface extends ManagerInterface {

Expand Down
5 changes: 2 additions & 3 deletions src/Discovery/Discoverer.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
namespace swichers\Acsf\Client\Discovery;

use Doctrine\Common\Annotations\Reader;
use ReflectionClass;
use Symfony\Component\Finder\Finder;

/**
* Class Discoverer.
* Dynamic Endpoint and Action discoverer.
*/
class Discoverer implements DiscovererInterface {

Expand Down Expand Up @@ -102,7 +101,7 @@ protected function discoverItems(): void {
foreach ($finder as $file) {
$class = $this->namespace . '\\' . $file->getBasename('.php');
$annotation = $this->annotationReader->getClassAnnotation(
new ReflectionClass($class),
new \ReflectionClass($class),
$this->annotationClass
);
if (!$annotation) {
Expand Down
2 changes: 1 addition & 1 deletion src/Discovery/DiscovererInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace swichers\Acsf\Client\Discovery;

/**
* Interface DiscovererInterface.
* Contract for discoverers.
*/
interface DiscovererInterface {

Expand Down
2 changes: 1 addition & 1 deletion src/Discovery/EntityManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace swichers\Acsf\Client\Discovery;

/**
* Class EntityManager.
* Manages Entity endpoints.
*/
class EntityManager extends Manager implements EntityManagerInterface {

Expand Down
2 changes: 1 addition & 1 deletion src/Discovery/EntityManagerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace swichers\Acsf\Client\Discovery;

/**
* Interface EntityManagerInterface.
* Contract for entity managers.
*/
interface EntityManagerInterface extends ManagerInterface {

Expand Down
2 changes: 1 addition & 1 deletion src/Discovery/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use swichers\Acsf\Client\Exceptions\MissingEndpointException;

/**
* Class Manager.
* Base manager for discovering entities and actions.
*/
class Manager implements ManagerInterface {

Expand Down
2 changes: 1 addition & 1 deletion src/Discovery/ManagerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use swichers\Acsf\Client\Endpoints\EndpointInterface;

/**
* Interface ManagerInterface.
* Contract for managers.
*/
interface ManagerInterface {

Expand Down
2 changes: 1 addition & 1 deletion src/Endpoints/EndpointInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace swichers\Acsf\Client\Endpoints;

/**
* Interface EndpointInterface.
* Contract for endpoint handlers.
*/
interface EndpointInterface {

Expand Down
2 changes: 1 addition & 1 deletion src/Endpoints/Entity/AbstractEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use swichers\Acsf\Client\ClientInterface;

/**
* Class AbstractEntity.
* Base Entity implementation.
*/
abstract class AbstractEntity implements EntityInterface {

Expand Down
Loading

0 comments on commit 84ec385

Please sign in to comment.