Included vendor/ to the project
This commit is contained in:
22
vendor/phpdocumentor/reflection-common/LICENSE
vendored
Normal file
22
vendor/phpdocumentor/reflection-common/LICENSE
vendored
Normal 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.
|
||||
|
||||
1
vendor/phpdocumentor/reflection-common/README.md
vendored
Normal file
1
vendor/phpdocumentor/reflection-common/README.md
vendored
Normal file
@@ -0,0 +1 @@
|
||||
# ReflectionCommon
|
||||
26
vendor/phpdocumentor/reflection-common/phpunit.xml.dist
vendored
Normal file
26
vendor/phpdocumentor/reflection-common/phpunit.xml.dist
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<phpunit bootstrap="tests/common/bootstrap.php" colors="true">
|
||||
<testsuites>
|
||||
<testsuite name="phpDocumentor">
|
||||
<directory>./tests/unit/</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
<filter>
|
||||
<whitelist>
|
||||
<directory suffix=".php">src</directory>
|
||||
</whitelist>
|
||||
</filter>
|
||||
<logging>
|
||||
<log type="coverage-html"
|
||||
title="phpDocumentor Reflection Common"
|
||||
target="build/coverage"
|
||||
charset="UTF-8"
|
||||
yui="true"
|
||||
highlight="false"
|
||||
lowUpperBound="35"
|
||||
highLowerBound="70" />
|
||||
<log type="coverage-clover" target="build/logs/clover.xml"/>
|
||||
<log type="junit" target="build/logs/junit.xml" logIncompleteSkipped="false" />
|
||||
</logging>
|
||||
</phpunit>
|
||||
32
vendor/phpdocumentor/reflection-common/src/Element.php
vendored
Normal file
32
vendor/phpdocumentor/reflection-common/src/Element.php
vendored
Normal 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();
|
||||
}
|
||||
40
vendor/phpdocumentor/reflection-common/src/File.php
vendored
Normal file
40
vendor/phpdocumentor/reflection-common/src/File.php
vendored
Normal 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();
|
||||
}
|
||||
78
vendor/phpdocumentor/reflection-common/src/Fqsen.php
vendored
Normal file
78
vendor/phpdocumentor/reflection-common/src/Fqsen.php
vendored
Normal file
@@ -0,0 +1,78 @@
|
||||
<?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('/^\\\\([\\w_\\\\]*)(?:[:]{2}\\$?([\\w_]+))?(?:\\(\\))?$/', $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;
|
||||
}
|
||||
}
|
||||
57
vendor/phpdocumentor/reflection-common/src/Location.php
vendored
Normal file
57
vendor/phpdocumentor/reflection-common/src/Location.php
vendored
Normal 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;
|
||||
}
|
||||
}
|
||||
25
vendor/phpdocumentor/reflection-common/src/Project.php
vendored
Normal file
25
vendor/phpdocumentor/reflection-common/src/Project.php
vendored
Normal 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();
|
||||
}
|
||||
27
vendor/phpdocumentor/reflection-common/src/ProjectFactory.php
vendored
Normal file
27
vendor/phpdocumentor/reflection-common/src/ProjectFactory.php
vendored
Normal 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);
|
||||
}
|
||||
10
vendor/phpdocumentor/reflection-common/tests/common/bootstrap.php
vendored
Normal file
10
vendor/phpdocumentor/reflection-common/tests/common/bootstrap.php
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
/**
|
||||
* phpDocumentor
|
||||
*
|
||||
* PHP Version 5.4
|
||||
*
|
||||
* @copyright 2010-2014 Mike van Riel / Naenius (http://www.naenius.com)
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||
* @link http://phpdoc.org
|
||||
*/
|
||||
88
vendor/phpdocumentor/reflection-common/tests/unit/FqsenTest.php
vendored
Normal file
88
vendor/phpdocumentor/reflection-common/tests/unit/FqsenTest.php
vendored
Normal file
@@ -0,0 +1,88 @@
|
||||
<?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;
|
||||
|
||||
/**
|
||||
* Class FqsenTest
|
||||
* @coversDefaultClass phpDocumentor\Reflection\Fqsen
|
||||
*/
|
||||
class FqsenTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @param string $fqsen
|
||||
* @covers ::__construct
|
||||
* @dataProvider validFqsenProvider
|
||||
*/
|
||||
public function testValidFormats($fqsen, $name)
|
||||
{
|
||||
$instance = new Fqsen($fqsen);
|
||||
$this->assertEquals($name, $instance->getName());
|
||||
}
|
||||
|
||||
/**
|
||||
* Data provider for ValidFormats tests. Contains a complete list from psr-5 draft.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function validFqsenProvider()
|
||||
{
|
||||
return [
|
||||
['\\', ''],
|
||||
['\My\Space', 'Space'],
|
||||
['\My\Space\myFunction()', 'myFunction'],
|
||||
['\My\Space\MY_CONSTANT', 'MY_CONSTANT'],
|
||||
['\My\Space\MY_CONSTANT2', 'MY_CONSTANT2'],
|
||||
['\My\Space\MyClass', 'MyClass'],
|
||||
['\My\Space\MyInterface', 'MyInterface'],
|
||||
['\My\Space\MyTrait', 'MyTrait'],
|
||||
['\My\Space\MyClass::myMethod()', 'myMethod'],
|
||||
['\My\Space\MyClass::$my_property', 'my_property'],
|
||||
['\My\Space\MyClass::MY_CONSTANT', 'MY_CONSTANT'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $fqsen
|
||||
* @covers ::__construct
|
||||
* @dataProvider invalidFqsenProvider
|
||||
* @expectedException \InvalidArgumentException
|
||||
*/
|
||||
public function testInValidFormats($fqsen)
|
||||
{
|
||||
new Fqsen($fqsen);
|
||||
}
|
||||
|
||||
/**
|
||||
* Data provider for invalidFormats tests. Contains a complete list from psr-5 draft.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function invalidFqsenProvider()
|
||||
{
|
||||
return [
|
||||
['\My\*'],
|
||||
['\My\Space\.()'],
|
||||
['My\Space'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers ::__construct
|
||||
* @covers ::__toString
|
||||
*/
|
||||
public function testToString()
|
||||
{
|
||||
$className = new Fqsen('\\phpDocumentor\\Application');
|
||||
|
||||
$this->assertEquals('\\phpDocumentor\\Application', (string)$className);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user