Skip to content

Commit

Permalink
Fix PSR-2 naming convention issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Frederic Dewinne committed Oct 28, 2015
1 parent 5d2e2fc commit 950516c
Show file tree
Hide file tree
Showing 42 changed files with 197 additions and 131 deletions.
155 changes: 89 additions & 66 deletions composer.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/phpDocumentor/ApiReference/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,4 @@ public function getElements()
{
return $this->elements;
}
}
}
4 changes: 1 addition & 3 deletions src/phpDocumentor/ApiReference/DocumentGroupDefinition.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

namespace phpDocumentor\ApiReference;


use Flyfinder\Specification\SpecificationInterface;
use League\Flysystem\FilesystemInterface;
use phpDocumentor\DocumentGroupDefinition as DocumentGroupDefinitionInterface;
Expand Down Expand Up @@ -49,8 +48,7 @@ public function __construct(
DocumentGroupFormat $format,
FilesystemInterface $filesystem,
SpecificationInterface $specification
)
{
) {
$this->format = $format;
$this->filesystem = $filesystem;
$this->specification = $specification;
Expand Down
2 changes: 1 addition & 1 deletion src/phpDocumentor/Application/Cli/Command/ListCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ protected function configure()
'Displays a listing of all available templates in phpDocumentor'
)
->setHelp(
<<<HELP
<<<HELP
This task outputs a list of templates as available in phpDocumentor.
Please mind that custom templates which are situated outside phpDocumentor are not
shown in this listing.
Expand Down
11 changes: 8 additions & 3 deletions src/phpDocumentor/Application/Cli/Command/RunCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ protected function configure()
'Parses and transforms the given files to a specified location'
)
->setHelp(
<<<HELP
<<<HELP
phpDocumentor creates documentation from PHP source files. The simplest way
to use it is:
Expand Down Expand Up @@ -297,14 +297,19 @@ protected function execute(InputInterface $input, OutputInterface $output)
);
}

foreach($this->definitionRepository->fetchAll() as $definition) {
foreach ($this->definitionRepository->fetchAll() as $definition) {
$documentation = $this->documentationRepository->findByVersionNumber($definition->getVersionNumber());

if ($documentation === null) {
$documentation = $this->documentationFactory->create($definition);
$this->documentationRepository->save($documentation);
}
$this->commandBus->handle(new Render(sys_get_temp_dir() . '/phpdoc', $input->getOption('template') ?: ['clean']));
$this->commandBus->handle(
new Render(
sys_get_temp_dir() . '/phpdoc',
$input->getOption('template') ?: ['clean']
)
);
}


Expand Down
2 changes: 1 addition & 1 deletion src/phpDocumentor/DefinitionFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ interface DefinitionFactory
* @return Definition
*/
public function create(array $options);
}
}
2 changes: 1 addition & 1 deletion src/phpDocumentor/DocumentGroupDefinitionFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
interface DocumentGroupDefinitionFactory extends DefinitionFactory
{

}
}
2 changes: 1 addition & 1 deletion src/phpDocumentor/DocumentGroupFormat.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function getFormat()
*
* @return string
*/
function __toString()
public function __toString()
{
return $this->getFormat();
}
Expand Down
1 change: 1 addition & 0 deletions src/phpDocumentor/Documentation.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
*/

namespace phpDocumentor;

use phpDocumentor\Project\VersionNumber;

/**
Expand Down
1 change: 1 addition & 0 deletions src/phpDocumentor/DocumentationRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
*/

namespace phpDocumentor;

use phpDocumentor\Project\VersionNumber;
use Stash\Pool;

Expand Down
2 changes: 1 addition & 1 deletion src/phpDocumentor/Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
class Exception extends BaseException
{

}
}
2 changes: 1 addition & 1 deletion src/phpDocumentor/FactoryNotFoundException.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
final class FactoryNotFoundException extends Exception
{

}
}
1 change: 0 additions & 1 deletion src/phpDocumentor/FlySystemFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ public function create(Dsn $dsn)
$filesystem = $this->mountManager->getFilesystem($dsnId);
} catch (LogicException $e) {
if ($dsn->getScheme() === 'file') {

$path = $dsn->getPath();
$filesystem = new Filesystem(new Local($path, LOCK_EX, Local::SKIP_LINKS));

Expand Down
1 change: 1 addition & 0 deletions src/phpDocumentor/Guides/Document.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
*/

namespace phpDocumentor\Guides;

use phpDocumentor\Path;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ public function create(array $paths, array $ignore, array $extensions)
$ignoreSpec = $this->orSpec(new IsHidden(), $ignoreSpec);
}

return new AndSpecification($pathSpec,
return new AndSpecification(
$pathSpec,
new AndSpecification(
new NotSpecification($ignoreSpec),
new HasExtension($extensions)
Expand Down Expand Up @@ -88,4 +89,3 @@ private function inPath($path)
return new InPath(new Path($path));
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@
*/
class DoesArgumentTypehintMatchParam extends Constraint
{
// @codingStandardsIgnoreStart
/** @var string message */
public $message = 'The type hint of the argument is incorrect for the type definition of the @param tag with argument %s in %s';
// @codingStandardsIgnoreEnd

public $code = 50016;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,12 @@
// if (count($this->docblock->getTagsByName($tag)) < 1) {
// continue;
// }
// $this->logParserError('CRITICAL', 'Found deprecated tag "%s" in %s', $this->lineNumber, array($tag, $this->entityName));
// $this->logParserError(
// 'CRITICAL',
// 'Found deprecated tag "%s" in %s',
// $this->lineNumber,
// array($tag, $this->entityName)
// );
// }
// }
//}
9 changes: 6 additions & 3 deletions src/phpDocumentor/Project/Version/DefinitionFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ private function createDocumentGroupDefinitions(array $options)
$documentGroups = array();

foreach ($options as $documentGroupType => $documentGroupOptions) {
if(is_array($documentGroupOptions)) {
if (is_array($documentGroupOptions)) {
$factory = $this->findFactory($documentGroupType, $documentGroupOptions['format']);
$documentGroups[] = $factory->create($documentGroupOptions);
}
Expand Down Expand Up @@ -93,8 +93,11 @@ private function findFactory($type, $format)
* @param DocumentGroupFormat $format
* @param DocumentGroupDefinitionFactory $factory
*/
public function registerDocumentGroupDefinitionFactory($type, DocumentGroupFormat $format, DocumentGroupDefinitionFactory $factory)
{
public function registerDocumentGroupDefinitionFactory(
$type,
DocumentGroupFormat $format,
DocumentGroupDefinitionFactory $factory
) {
$this->documentGroupDefinitionFactories[$type][(string)$format] = $factory;
}
}
1 change: 1 addition & 0 deletions src/phpDocumentor/Project/Version/DefinitionRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
*/

namespace phpDocumentor\Project\Version;

use phpDocumentor\ConfigurationFactory;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,3 @@ public function path($filePath)
return $filePath;
}
}

2 changes: 1 addition & 1 deletion src/phpDocumentor/Renderer/Action/SourcecodeHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function __invoke(Action $action)
$fs = $action->getRenderPass()->getFilesystem();
$fs->put(
$path.'.html',
<<<HTML
<<<HTML
<html>
<head>
<script
Expand Down
1 change: 0 additions & 1 deletion src/phpDocumentor/Renderer/Action/Xml/Tag/AuthorTag.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ public function process(\DOMDocument $xml)

/** @var \DOMElement $node */
foreach ($nodes as $node) {

// FIXME: #193
if (preg_match($regex, $node->nodeValue, $matches)) {
if ($matches['name']) {
Expand Down
1 change: 0 additions & 1 deletion src/phpDocumentor/Renderer/Action/Xml/Tag/CoversTag.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ public function process(\DOMDocument $xml)
$referral_name = $node->parentNode->parentNode
->getElementsByTagName('full_name')->item(0)->nodeValue;
} else {

$referral_class_name = null;
if ($node->parentNode->parentNode->nodeName == 'method') {
// gather the name of the class where the @covers is in
Expand Down
1 change: 0 additions & 1 deletion src/phpDocumentor/Renderer/Action/Xml/Tag/LicenseTag.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ public function process(\DOMDocument $xml)

/** @var \DOMElement $node */
foreach ($nodes as $node) {

$license = $node->nodeValue;

// FIXME: migrate to '#^' . PHPDOC::LINK_REGEX . '(\s+(?P<text>.+))
Expand Down
1 change: 0 additions & 1 deletion src/phpDocumentor/Renderer/Action/Xml/Tag/UsesTag.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ public function process(\DOMDocument $xml)
$referral_name = $node->parentNode->parentNode
->getElementsByTagName('full_name')->item(0)->nodeValue;
} else {

$referral_class_name = null;
if ($node->parentNode->parentNode->nodeName == 'method') {
// gather the name of the class where the @uses is in
Expand Down
5 changes: 2 additions & 3 deletions tests/unit/phpDocumentor/BootstrapTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ public function testFindVendorPathComposerInstalled()
$bootstrap = Bootstrap::createInstance();
$baseDir = vfsStream::url('root/dummy/vendor/phpDocumentor/phpDocumentor/src/phpDocumentor');
$this->assertSame(
'vfs://root/dummy/vendor/phpDocumentor/phpDocumentor/src/phpDocumentor/../../../../../vendor'
, $bootstrap->findVendorPath($baseDir)
'vfs://root/dummy/vendor/phpDocumentor/phpDocumentor/src/phpDocumentor/../../../../../vendor',
$bootstrap->findVendorPath($baseDir)
);
}

Expand Down Expand Up @@ -126,5 +126,4 @@ public function testCreateAutoloader()
$bootstrap = Bootstrap::createInstance();
$this->assertTrue($bootstrap->createAutoloader(vfsStream::url('root/dummy/vendor')));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,18 @@

namespace phpDocumentor\ConfigurationFactory;

require_once(__DIR__ . '/../../../../tests/data/phpDocumentor2ExpectedArray.php');

/**
* Test case for PhpDocumentor2
*
* @coversDefaultClass phpDocumentor\ConfigurationFactory\PhpDocumentor2
*/
final class PhpDocumentor2Test extends \PHPUnit_Framework_TestCase
{
public function setUp()
{
require_once(__DIR__ . '/../../../../tests/data/phpDocumentor2ExpectedArray.php');
}

/**
* @covers ::convert
* @covers ::<private>
Expand Down Expand Up @@ -73,7 +76,11 @@ public function testItMatchesWhenVersionIsEmpty()
*/
public function testItRevertsToDefaultsIfValuesAreNotInTheConfigurationFile()
{
$xml = new \SimpleXMLElement(__DIR__ . '/../../../../tests/data/phpDocumentor2XMLWithoutExtensions.xml', 0, true);
$xml = new \SimpleXMLElement(
__DIR__ . '/../../../../tests/data/phpDocumentor2XMLWithoutExtensions.xml',
0,
true
);

$phpDocumentor2 = new PhpDocumentor2();
$array = $phpDocumentor2->convert($xml);
Expand All @@ -87,7 +94,11 @@ public function testItRevertsToDefaultsIfValuesAreNotInTheConfigurationFile()
*/
public function testItAcceptsMultipleIgnorePathsInThePhpdoc2Xml()
{
$xml = new \SimpleXMLElement(__DIR__ . '/../../../../tests/data/phpDocumentor2XMLWithMultipleIgnorePaths.xml', 0, true);
$xml = new \SimpleXMLElement(
__DIR__ . '/../../../../tests/data/phpDocumentor2XMLWithMultipleIgnorePaths.xml',
0,
true
);

$phpDocumentor2 = new PhpDocumentor2();
$array = $phpDocumentor2->convert($xml);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,18 @@

namespace phpDocumentor\ConfigurationFactory;

require_once(__DIR__ . '/../../../../tests/data/phpDocumentor3ExpectedArrays.php');

/**
* Test case for PhpDocumentor3
*
* @coversDefaultClass phpDocumentor\ConfigurationFactory\PhpDocumentor3
*/
final class PhpDocumentor3Test extends \PHPUnit_Framework_TestCase
{
public function setUp()
{
require_once(__DIR__ . '/../../../../tests/data/phpDocumentor3ExpectedArrays.php');
}

/**
* @covers ::__construct
* @covers ::convert
Expand Down Expand Up @@ -97,7 +100,11 @@ public function testItSetsDefaultValuesIfNoneAreFoundInThePhpdoc3Xml()
*/
public function testItAcceptsMultipleVersionsInThePhpdoc3Xml()
{
$xml = new \SimpleXMLElement(__DIR__ . '/../../../../tests/data/phpDocumentor3XMLWithMultipleVersions.xml', 0, true);
$xml = new \SimpleXMLElement(
__DIR__ . '/../../../../tests/data/phpDocumentor3XMLWithMultipleVersions.xml',
0,
true
);

$phpDocumentor3 = new PhpDocumentor3('');
$array = $phpDocumentor3->convert($xml);
Expand All @@ -112,7 +119,11 @@ public function testItAcceptsMultipleVersionsInThePhpdoc3Xml()
*/
public function testItAcceptsMultipleApisInThePhpdoc3Xml()
{
$xml = new \SimpleXMLElement(__DIR__ . '/../../../../tests/data/phpDocumentor3XMLWithMultipleApis.xml', 0, true);
$xml = new \SimpleXMLElement(
__DIR__ . '/../../../../tests/data/phpDocumentor3XMLWithMultipleApis.xml',
0,
true
);

$phpDocumentor3 = new PhpDocumentor3('');
$array = $phpDocumentor3->convert($xml);
Expand All @@ -127,7 +138,11 @@ public function testItAcceptsMultipleApisInThePhpdoc3Xml()
*/
public function testItAcceptsMultipleGuidesInThePhpdoc3Xml()
{
$xml = new \SimpleXMLElement(__DIR__ . '/../../../../tests/data/phpDocumentor3XMLWithMultipleGuides.xml', 0, true);
$xml = new \SimpleXMLElement(
__DIR__ . '/../../../../tests/data/phpDocumentor3XMLWithMultipleGuides.xml',
0,
true
);

$phpDocumentor3 = new PhpDocumentor3('');
$array = $phpDocumentor3->convert($xml);
Expand All @@ -142,7 +157,11 @@ public function testItAcceptsMultipleGuidesInThePhpdoc3Xml()
*/
public function testItAcceptsMultipleTemplatesInThePhpdoc3Xml()
{
$xml = new \SimpleXMLElement(__DIR__ . '/../../../../tests/data/phpDocumentor3XMLWithMultipleTemplates.xml', 0, true);
$xml = new \SimpleXMLElement(
__DIR__ . '/../../../../tests/data/phpDocumentor3XMLWithMultipleTemplates.xml',
0,
true
);

$phpDocumentor3 = new PhpDocumentor3('');
$array = $phpDocumentor3->convert($xml);
Expand Down
1 change: 0 additions & 1 deletion tests/unit/phpDocumentor/DocumentationFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,5 +103,4 @@ public function testDocumentGroupFactoryShouldHaveMatch()
$this->fixture->addDocumentGroupFactory($this->documentGroupFactoryMock);
$this->fixture->create($versionDefinition);
}

}
Loading

0 comments on commit 950516c

Please sign in to comment.