This commit is contained in:
aschwarz
2023-05-12 12:27:19 +02:00
parent 757c2388de
commit e2f1846f03
1974 changed files with 255998 additions and 0 deletions

View File

@ -0,0 +1,35 @@
language: php
php:
- 5.5
- 5.6
- 7.0
- 7.1
- hhvm
- nightly
matrix:
allow_failures:
- php:
- hhvm
- nightly
cache:
directories:
- $HOME/.composer/cache
script:
- vendor/bin/phpunit --coverage-clover=coverage.clover -v
- composer update --no-interaction --prefer-source
- vendor/bin/phpunit -v
before_script:
- composer install --no-interaction
after_script:
- if [ $TRAVIS_PHP_VERSION = '5.6' ]; then wget https://scrutinizer-ci.com/ocular.phar; php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi
notifications:
irc: "irc.freenode.org#phpdocumentor"
email:
- me@mikevanriel.com
- ashnazg@php.net

View File

@ -0,0 +1,22 @@
The MIT License (MIT)
Copyright (c) 2015 phpDocumentor
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -0,0 +1,2 @@
# ReflectionCommon
[![Build Status](https://travis-ci.org/phpDocumentor/ReflectionCommon.svg?branch=master)](https://travis-ci.org/phpDocumentor/ReflectionCommon)

View File

@ -0,0 +1,29 @@
{
"name": "phpdocumentor/reflection-common",
"keywords": ["phpdoc", "phpDocumentor", "reflection", "static analysis", "FQSEN"],
"homepage": "http://www.phpdoc.org",
"description": "Common reflection classes used by phpdocumentor to reflect the code structure",
"license": "MIT",
"authors": [
{
"name": "Jaap van Otterdijk",
"email": "opensource@ijaap.nl"
}
],
"require": {
"php": ">=5.5"
},
"autoload" : {
"psr-4" : {
"phpDocumentor\\Reflection\\": ["src"]
}
},
"require-dev": {
"phpunit/phpunit": "^4.6"
},
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
}
}

View File

@ -0,0 +1,32 @@
<?php
/**
* phpDocumentor
*
* PHP Version 5.5
*
* @copyright 2010-2015 Mike van Riel / Naenius (http://www.naenius.com)
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://phpdoc.org
*/
namespace phpDocumentor\Reflection;
/**
* Interface for Api Elements
*/
interface Element
{
/**
* Returns the Fqsen of the element.
*
* @return Fqsen
*/
public function getFqsen();
/**
* Returns the name of the element.
*
* @return string
*/
public function getName();
}

View File

@ -0,0 +1,40 @@
<?php
/**
* This file is part of phpDocumentor.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @copyright 2010-2015 Mike van Riel<mike@phpdoc.org>
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://phpdoc.org
*/
namespace phpDocumentor\Reflection;
/**
* Interface for files processed by the ProjectFactory
*/
interface File
{
/**
* Returns the content of the file as a string.
*
* @return string
*/
public function getContents();
/**
* Returns md5 hash of the file.
*
* @return string
*/
public function md5();
/**
* Returns an relative path to the file.
*
* @return string
*/
public function path();
}

View File

@ -0,0 +1,82 @@
<?php
/**
* phpDocumentor
*
* PHP Version 5.5
*
* @copyright 2010-2015 Mike van Riel / Naenius (http://www.naenius.com)
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://phpdoc.org
*/
namespace phpDocumentor\Reflection;
/**
* Value Object for Fqsen.
*
* @link https://github.com/phpDocumentor/fig-standards/blob/master/proposed/phpdoc-meta.md
*/
final class Fqsen
{
/**
* @var string full quallified class name
*/
private $fqsen;
/**
* @var string name of the element without path.
*/
private $name;
/**
* Initializes the object.
*
* @param string $fqsen
*
* @throws \InvalidArgumentException when $fqsen is not matching the format.
*/
public function __construct($fqsen)
{
$matches = array();
$result = preg_match(
'/^\\\\([a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff\\\\]*)?(?:[:]{2}\\$?([a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*))?(?:\\(\\))?$/',
$fqsen,
$matches
);
if ($result === 0) {
throw new \InvalidArgumentException(
sprintf('"%s" is not a valid Fqsen.', $fqsen)
);
}
$this->fqsen = $fqsen;
if (isset($matches[2])) {
$this->name = $matches[2];
} else {
$matches = explode('\\', $fqsen);
$this->name = trim(end($matches), '()');
}
}
/**
* converts this class to string.
*
* @return string
*/
public function __toString()
{
return $this->fqsen;
}
/**
* Returns the name of the element without path.
*
* @return string
*/
public function getName()
{
return $this->name;
}
}

View File

@ -0,0 +1,57 @@
<?php
/**
* This file is part of phpDocumentor.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @copyright 2010-2015 Mike van Riel<mike@phpdoc.org>
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://phpdoc.org
*/
namespace phpDocumentor\Reflection;
/**
* The location where an element occurs within a file.
*/
final class Location
{
/** @var int */
private $lineNumber = 0;
/** @var int */
private $columnNumber = 0;
/**
* Initializes the location for an element using its line number in the file and optionally the column number.
*
* @param int $lineNumber
* @param int $columnNumber
*/
public function __construct($lineNumber, $columnNumber = 0)
{
$this->lineNumber = $lineNumber;
$this->columnNumber = $columnNumber;
}
/**
* Returns the line number that is covered by this location.
*
* @return integer
*/
public function getLineNumber()
{
return $this->lineNumber;
}
/**
* Returns the column number (character position on a line) for this location object.
*
* @return integer
*/
public function getColumnNumber()
{
return $this->columnNumber;
}
}

View File

@ -0,0 +1,25 @@
<?php
/**
* phpDocumentor
*
* PHP Version 5.5
*
* @copyright 2010-2015 Mike van Riel / Naenius (http://www.naenius.com)
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://phpdoc.org
*/
namespace phpDocumentor\Reflection;
/**
* Interface for project. Since the definition of a project can be different per factory this interface will be small.
*/
interface Project
{
/**
* Returns the name of the project.
*
* @return string
*/
public function getName();
}

View File

@ -0,0 +1,27 @@
<?php
/**
* phpDocumentor
*
* PHP Version 5.5
*
* @copyright 2010-2015 Mike van Riel / Naenius (http://www.naenius.com)
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://phpdoc.org
*/
namespace phpDocumentor\Reflection;
/**
* Interface for project factories. A project factory shall convert a set of files
* into an object implementing the Project interface.
*/
interface ProjectFactory
{
/**
* Creates a project from the set of files.
*
* @param string $name
* @param File[] $files
* @return Project
*/
public function create($name, array $files);
}