forked from elger/PHP_CodeBrowser
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Composer update #72 & fix semver OR condition phpunit ^9.0 php-file-iterator ^3.0 in composer OR condition is represented through double pipes (||). https://getcomposer.org/doc/articles/versions.md#version-range * Remove travis check * Enable github actions for ci check on php 7.3 and 7.4
- Loading branch information
Showing
36 changed files
with
840 additions
and
710 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ | ||
description = "A php test environment flake"; | ||
|
||
outputs = { self, nixpkgs }: | ||
let | ||
system = "x86_64-linux"; | ||
pkgs = nixpkgs.legacyPackages."${system}"; | ||
|
||
phpEnv = phpPackage: (phpPackage.buildEnv { | ||
extensions = { enabled, all }: (enabled ++ [ all.xdebug ]); | ||
extraConfig = '' | ||
memory_limit=-1 | ||
xdebug.mode=coverage | ||
'' + | ||
pkgs.lib.optionalString (pkgs.lib.versionOlder phpPackage.version "8.0") '' | ||
xdebug.coverage_enable=1 | ||
''; | ||
}); | ||
|
||
phpVersions = [ | ||
"php73" | ||
"php74" | ||
"php80" | ||
]; | ||
in | ||
{ | ||
packages."${system}" = builtins.listToAttrs | ||
(builtins.map | ||
(name: | ||
{ | ||
name = "env-${name}"; | ||
value = pkgs.symlinkJoin { | ||
name = "env-${name}"; | ||
paths = [ | ||
(phpEnv pkgs."${name}") | ||
(phpEnv pkgs."${name}").packages.composer2 | ||
]; | ||
}; | ||
} | ||
) | ||
phpVersions); | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Simple Nix Flakes powered php ci. | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
ci: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
php: [php73, php74] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
# Nix Flakes doesn't work on shallow clones | ||
fetch-depth: 0 | ||
|
||
- uses: cachix/install-nix-action@v12 | ||
with: | ||
install_url: https://github.com/numtide/nix-flakes-installer/releases/download/nix-2.4pre20201221_9fab14a/install | ||
extra_nix_config: | | ||
experimental-features = nix-command flakes | ||
- name: Cache Composer dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: /home/runner/.cache/composer | ||
key: ${{ runner.os }}-composer-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-composer- | ||
- run: | | ||
rm -fr vendor | ||
nix shell .github#env-${{ matrix.php }} --command composer ci-prepare | ||
nix shell .github#env-${{ matrix.php }} --command composer ci |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
<?php | ||
|
||
/** | ||
* Abstract Plugin | ||
* | ||
|
@@ -36,45 +37,45 @@ | |
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
* POSSIBILITY OF SUCH DAMAGE. | ||
* | ||
* @category PHP_CodeBrowser | ||
* @category PHP_CodeBrowser | ||
* | ||
* @author Elger Thiele <[email protected]> | ||
* @author Michel Hartmann <[email protected]> | ||
* @author Elger Thiele <[email protected]> | ||
* @author Michel Hartmann <[email protected]> | ||
* | ||
* @copyright 2007-2010 Mayflower GmbH | ||
* | ||
* @license http://www.opensource.org/licenses/bsd-license.php BSD License | ||
* @license http://www.opensource.org/licenses/bsd-license.php BSD License | ||
* | ||
* @version SVN: $Id$ | ||
* @version SVN: $Id$ | ||
* | ||
* @link http://www.phpunit.de/ | ||
* @link http://www.phpunit.de/ | ||
* | ||
* @since File available since 0.1.0 | ||
* @since File available since 0.1.0 | ||
*/ | ||
|
||
namespace PHPCodeBrowser; | ||
|
||
use \DOMElement; | ||
use \DOMNode; | ||
use \DOMNodeList; | ||
use DOMElement; | ||
use DOMNode; | ||
use DOMNodeList; | ||
|
||
/** | ||
* AbstractPlugin | ||
* | ||
* @category PHP_CodeBrowser | ||
* @category PHP_CodeBrowser | ||
* | ||
* @author Elger Thiele <[email protected]> | ||
* @author Michel Hartmann <[email protected]> | ||
* @author Elger Thiele <[email protected]> | ||
* @author Michel Hartmann <[email protected]> | ||
* | ||
* @copyright 2007-2010 Mayflower GmbH | ||
* | ||
* @license http://www.opensource.org/licenses/bsd-license.php BSD License | ||
* @license http://www.opensource.org/licenses/bsd-license.php BSD License | ||
* | ||
* @version Release: @package_version@ | ||
* @version Release: @package_version@ | ||
* | ||
* @link http://www.phpunit.de/ | ||
* @link http://www.phpunit.de/ | ||
* | ||
* @since Class available since 0.1.0 | ||
* @since Class available since 0.1.0 | ||
*/ | ||
abstract class AbstractPlugin | ||
{ | ||
|
@@ -179,7 +180,7 @@ public function getIssuesByFile(string $filename): array | |
$issues = []; | ||
|
||
foreach ($this->getIssueNodes($filename) as $issueNode) { | ||
$issues = array_merge( | ||
$issues = \array_merge( | ||
$issues, | ||
$this->mapIssues($issueNode, $filename) | ||
); | ||
|
@@ -197,14 +198,14 @@ public function getFilesWithIssues(): array | |
{ | ||
$fileNames = []; | ||
$issueNodes = $this->issueXml->query( | ||
sprintf('/*/%s/file[@name]', $this->pluginName) | ||
\sprintf('/*/%s/file[@name]', $this->pluginName) | ||
); | ||
|
||
foreach ($issueNodes as $node) { | ||
$fileNames[] = $node->getAttribute('name'); | ||
} | ||
|
||
return array_unique($fileNames); | ||
return \array_unique($fileNames); | ||
} | ||
|
||
/** | ||
|
@@ -250,12 +251,13 @@ public function mapIssues(DOMNode $element, string $filename): array | |
protected function getIssueNodes(string $filename): DOMNodeList | ||
{ | ||
return $this->issueXml->query( | ||
sprintf('/*/%s/file[@name="%s"]', $this->pluginName, $filename) | ||
\sprintf('/*/%s/file[@name="%s"]', $this->pluginName, $filename) | ||
); | ||
} | ||
|
||
/** | ||
* Default method for retrieving the first line of an issue. | ||
* | ||
* @see self::mapIssues | ||
* | ||
* @param DOMElement $element | ||
|
@@ -269,6 +271,7 @@ protected function getLineStart(DOMElement $element): int | |
|
||
/** | ||
* Default method for retrieving the last line of an issue. | ||
* | ||
* @see self::mapIssues | ||
* | ||
* @param DOMElement $element | ||
|
@@ -282,6 +285,7 @@ protected function getLineEnd(DOMElement $element): int | |
|
||
/** | ||
* Default method for retrieving the source of an issue. | ||
* | ||
* @see self::mapIssues | ||
* | ||
* @return string | ||
|
@@ -293,6 +297,7 @@ protected function getSource(): string | |
|
||
/** | ||
* Default method for retrieving the description of an issue. | ||
* | ||
* @see self::mapIssues | ||
* | ||
* @param DOMElement $element | ||
|
@@ -301,11 +306,12 @@ protected function getSource(): string | |
*/ | ||
protected function getDescription(DOMElement $element): string | ||
{ | ||
return htmlentities($element->getAttribute($this->descriptionAttr)); | ||
return \htmlentities($element->getAttribute($this->descriptionAttr)); | ||
} | ||
|
||
/** | ||
* Default method for retrieving the severity of an issue. | ||
* | ||
* @see self::mapIssues | ||
* | ||
* @param DOMElement $element | ||
|
@@ -314,6 +320,6 @@ protected function getDescription(DOMElement $element): string | |
*/ | ||
protected function getSeverity(DOMElement $element): string | ||
{ | ||
return htmlentities($element->getAttribute($this->severityAttr)); | ||
return \htmlentities($element->getAttribute($this->severityAttr)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
<?php | ||
|
||
/** | ||
* Application | ||
* | ||
|
@@ -36,19 +37,19 @@ | |
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
* POSSIBILITY OF SUCH DAMAGE. | ||
* | ||
* @category PHP_CodeBrowser | ||
* @category PHP_CodeBrowser | ||
* | ||
* @author Robin Gloster <[email protected]> | ||
* @author Robin Gloster <[email protected]> | ||
* | ||
* @copyright 2007-2010 Mayflower GmbH | ||
* | ||
* @license http://www.opensource.org/licenses/bsd-license.php BSD License | ||
* @license http://www.opensource.org/licenses/bsd-license.php BSD License | ||
* | ||
* @version SVN: $Id$ | ||
* @version SVN: $Id$ | ||
* | ||
* @link http://www.phpunit.de/ | ||
* @link http://www.phpunit.de/ | ||
* | ||
* @since File available since 1.1 | ||
* @since File available since 1.1 | ||
*/ | ||
|
||
namespace PHPCodeBrowser; | ||
|
Oops, something went wrong.