Skip to content

Commit

Permalink
Update own code to PSR-12
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashoka de Wit committed Jun 11, 2020
1 parent d34a187 commit d79c84b
Show file tree
Hide file tree
Showing 28 changed files with 100 additions and 21 deletions.
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"email": "contact@mediact.nl"
}
],
"version": "2.0.6",
"version": "2.1.0",
"require": {
"php": "^7.1",
"composer-plugin-api": "^1.0"
Expand All @@ -18,7 +18,7 @@
"phpunit/phpunit": "^7.5",
"composer/composer": "^1.3",
"kint-php/kint": "@stable",
"mediact/testing-suite": "^1.20",
"mediact/testing-suite": "^2.0",
"mikey179/vfsstream": "^1.6"
},
"autoload": {
Expand All @@ -43,7 +43,8 @@
"/phpmd.xml",
"/phpstan.neon",
"/phpcs.xml",
"/grumphp.yml"
"/grumphp.yml",
"/pdepend.xml"
]
},
"config": {
Expand Down
11 changes: 11 additions & 0 deletions pdepend.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0"?>
<symfony:container xmlns:symfony="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://pdepend.org/schema/dic/pdepend"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<config>
<cache>
<driver>memory</driver>
</cache>
</config>
</symfony:container>
1 change: 1 addition & 0 deletions src/Environment.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Copyright MediaCT. All rights reserved.
* https://www.mediact.nl
Expand Down
5 changes: 4 additions & 1 deletion src/EnvironmentInterface.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
<?php declare(strict_types=1);
<?php

/**
* Copyright MediaCT. All rights reserved.
* https://www.mediact.nl
*/

declare(strict_types=1);

namespace Mediact\CodingStandard\PhpStorm;

use Composer\Composer;
Expand Down
5 changes: 4 additions & 1 deletion src/Filesystem.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
<?php declare(strict_types=1);
<?php

/**
* Copyright MediaCT. All rights reserved.
* https://www.mediact.nl
*/

declare(strict_types=1);

namespace Mediact\CodingStandard\PhpStorm;

use RecursiveDirectoryIterator;
Expand Down
1 change: 1 addition & 0 deletions src/FilesystemInterface.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Copyright MediaCT. All rights reserved.
* https://www.mediact.nl
Expand Down
5 changes: 4 additions & 1 deletion src/InstallerPlugin.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
<?php declare(strict_types=1);
<?php

/**
* Copyright MediaCT. All rights reserved.
* https://www.mediact.nl
* @deprecated
*/

declare(strict_types=1);

namespace Mediact\CodingStandard\PhpStorm;

use Composer\Composer;
Expand Down
5 changes: 4 additions & 1 deletion src/Patcher/CodeStylePatcher.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
<?php declare(strict_types=1);
<?php

/**
* Copyright MediaCT. All rights reserved.
* https://www.mediact.nl
*/

declare(strict_types=1);

namespace Mediact\CodingStandard\PhpStorm\Patcher;

use Mediact\CodingStandard\PhpStorm\EnvironmentInterface;
Expand Down
5 changes: 4 additions & 1 deletion src/Patcher/ConfigPatcher.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
<?php declare(strict_types=1);
<?php

/**
* Copyright MediaCT. All rights reserved.
* https://www.mediact.nl
*/

declare(strict_types=1);

namespace Mediact\CodingStandard\PhpStorm\Patcher;

use Mediact\CodingStandard\PhpStorm\EnvironmentInterface;
Expand Down
5 changes: 4 additions & 1 deletion src/Patcher/ConfigPatcherInterface.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
<?php declare(strict_types=1);
<?php

/**
* Copyright MediaCT. All rights reserved.
* https://www.mediact.nl
*/

declare(strict_types=1);

namespace Mediact\CodingStandard\PhpStorm\Patcher;

use Mediact\CodingStandard\PhpStorm\EnvironmentInterface;
Expand Down
5 changes: 4 additions & 1 deletion src/Patcher/CopyFilesTrait.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
<?php declare(strict_types=1);
<?php

/**
* Copyright MediaCT. All rights reserved.
* https://www.mediact.nl
*/

declare(strict_types=1);

namespace Mediact\CodingStandard\PhpStorm\Patcher;

use Mediact\CodingStandard\PhpStorm\FilesystemInterface;
Expand Down
5 changes: 4 additions & 1 deletion src/Patcher/FileTemplatesPatcher.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
<?php declare(strict_types=1);
<?php

/**
* Copyright MediaCT. All rights reserved.
* https://www.mediact.nl
*/

declare(strict_types=1);

namespace Mediact\CodingStandard\PhpStorm\Patcher;

use Mediact\CodingStandard\PhpStorm\EnvironmentInterface;
Expand Down
9 changes: 6 additions & 3 deletions src/Patcher/InspectionsPatcher.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
<?php declare(strict_types=1);
<?php

/**
* Copyright MediaCT. All rights reserved.
* https://www.mediact.nl
*/

declare(strict_types=1);

namespace Mediact\CodingStandard\PhpStorm\Patcher;

use Mediact\CodingStandard\PhpStorm\EnvironmentInterface;
Expand All @@ -14,8 +17,8 @@ class InspectionsPatcher implements ConfigPatcherInterface
{
use CopyFilesTrait;

const PROJECT_PHPCS = 'phpcs.xml';
const INSPECTION_PROFILE = 'inspectionProfiles/MediaCT.xml';
public const PROJECT_PHPCS = 'phpcs.xml';
public const INSPECTION_PROFILE = 'inspectionProfiles/MediaCT.xml';

/**
* @var XmlAccessorInterface
Expand Down
5 changes: 4 additions & 1 deletion src/Patcher/LiveTemplatesPatcher.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
<?php declare(strict_types=1);
<?php

/**
* Copyright MediaCT. All rights reserved.
* https://www.mediact.nl
*/

declare(strict_types=1);

namespace Mediact\CodingStandard\PhpStorm\Patcher;

use Mediact\CodingStandard\PhpStorm\EnvironmentInterface;
Expand Down
5 changes: 4 additions & 1 deletion src/Patcher/TemplateSettingsPatcher.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
<?php declare(strict_types=1);
<?php

/**
* Copyright MediaCT. All rights reserved.
* https://www.mediact.nl
*/

declare(strict_types=1);

namespace Mediact\CodingStandard\PhpStorm\Patcher;

use Mediact\CodingStandard\PhpStorm\EnvironmentInterface;
Expand Down
5 changes: 4 additions & 1 deletion src/Plugin.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
<?php declare(strict_types=1);
<?php

/**
* Copyright MediaCT. All rights reserved.
* https://www.mediact.nl
*/

declare(strict_types=1);

namespace Mediact\CodingStandard\PhpStorm;

use Composer\Composer;
Expand Down
8 changes: 6 additions & 2 deletions src/XmlAccessor.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
<?php declare(strict_types=1);
<?php

/**
* Copyright MediaCT. All rights reserved.
* https://www.mediact.nl
*/

declare(strict_types=1);

namespace Mediact\CodingStandard\PhpStorm;

use InvalidArgumentException;
Expand Down Expand Up @@ -52,7 +55,8 @@ public function getDescendant(
array $path
): SimpleXMLElement {
foreach ($path as $childProperties) {
if (!is_array($childProperties)
if (
!is_array($childProperties)
|| empty($childProperties)
) {
throw new InvalidArgumentException('Invalid descendant path');
Expand Down
5 changes: 4 additions & 1 deletion src/XmlAccessorInterface.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
<?php declare(strict_types=1);
<?php

/**
* Copyright MediaCT. All rights reserved.
* https://www.mediact.nl
*/

declare(strict_types=1);

namespace Mediact\CodingStandard\PhpStorm;

use InvalidArgumentException;
Expand Down
2 changes: 2 additions & 0 deletions tests/EnvironmentTest.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?php

/**
* Copyright MediaCT. All rights reserved.
* https://www.mediact.nl
*/

namespace Mediact\CodingStandard\PhpStorm\Tests;

use Composer\Composer;
Expand Down
2 changes: 2 additions & 0 deletions tests/FilesystemTest.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?php

/**
* Copyright MediaCT. All rights reserved.
* https://www.mediact.nl
*/

namespace Mediact\CodingStandard\PhpStorm\Tests;

use org\bovigo\vfs\vfsStream;
Expand Down
6 changes: 5 additions & 1 deletion tests/InstallerPluginTest.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
<?php declare(strict_types=1);
<?php

/**
* Copyright MediaCT. All rights reserved.
* https://www.mediact.nl
*/

declare(strict_types=1);

namespace Mediact\CodingStandard\PhpStorm\Tests;

use Composer\Composer;
Expand Down
2 changes: 2 additions & 0 deletions tests/Patcher/CodeStylePatcherTest.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?php

/**
* Copyright MediaCT. All rights reserved.
* https://www.mediact.nl
*/

namespace Mediact\CodingStandard\PhpStorm\Tests\Patcher;

use Mediact\CodingStandard\PhpStorm\EnvironmentInterface;
Expand Down
2 changes: 2 additions & 0 deletions tests/Patcher/ConfigPatcherTest.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?php

/**
* Copyright MediaCT. All rights reserved.
* https://www.mediact.nl
*/

namespace Mediact\CodingStandard\PhpStorm\Tests\Patcher;

use Mediact\CodingStandard\PhpStorm\EnvironmentInterface;
Expand Down
2 changes: 2 additions & 0 deletions tests/Patcher/CopyFilesTraitTest.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?php

/**
* Copyright MediaCT. All rights reserved.
* https://www.mediact.nl
*/

namespace Mediact\CodingStandard\PhpStorm\Tests\Patcher;

use Mediact\CodingStandard\PhpStorm\EnvironmentInterface;
Expand Down
2 changes: 2 additions & 0 deletions tests/Patcher/FileTemplatesPatcherTest.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?php

/**
* Copyright MediaCT. All rights reserved.
* https://www.mediact.nl
*/

namespace Mediact\CodingStandard\PhpStorm\Tests\Patcher;

use Mediact\CodingStandard\PhpStorm\EnvironmentInterface;
Expand Down
2 changes: 2 additions & 0 deletions tests/Patcher/InspectionsPatcherTest.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?php

/**
* Copyright MediaCT. All rights reserved.
* https://www.mediact.nl
*/

namespace Mediact\CodingStandard\PhpStorm\Tests\Patcher;

use Mediact\CodingStandard\PhpStorm\EnvironmentInterface;
Expand Down
2 changes: 2 additions & 0 deletions tests/Patcher/TestDouble/CopyFilesPatcherDouble.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?php

/**
* Copyright MediaCT. All rights reserved.
* https://www.mediact.nl
*/

namespace Mediact\CodingStandard\PhpStorm\Tests\Patcher\TestDouble;

use Mediact\CodingStandard\PhpStorm\EnvironmentInterface;
Expand Down
2 changes: 2 additions & 0 deletions tests/XmlAccessorTest.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?php

/**
* Copyright MediaCT. All rights reserved.
* https://www.mediact.nl
*/

namespace Mediact\CodingStandard\PhpStorm\Tests;

use PHPUnit\Framework\TestCase;
Expand Down

0 comments on commit d79c84b

Please sign in to comment.