Skip to content

Commit

Permalink
Add support for phpDocumentor in Makefile (#873)
Browse files Browse the repository at this point in the history
  • Loading branch information
ob-stripe authored Feb 13, 2020
1 parent b2aac10 commit cbcbec1
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 3 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Ignore build files
build/*

# Mac OS X dumps these all over the place.
.DS_Store

Expand All @@ -22,3 +25,7 @@ clover.xml

# Ignore PHPStan local config
.phpstan.neon

# Ignore phpDocumentor's local config and artifacts
.phpdoc/*
phpdoc.xml
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ before_install:

script:
- ./build.php ${AUTOLOAD}
- ./vendor/bin/php-cs-fixer fix -v --dry-run --using-cache=no .
- make fmtcheck
- if [[ `php -r "echo \version_compare(PHP_VERSION, '7.1', '>=');"` && $AUTOLOAD == 1 ]]; then make phpstan; fi

after_script: ./vendor/bin/php-coveralls -v
18 changes: 16 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
export PHPDOCUMENTOR_VERSION := v3.0.0-rc
export PHPSTAN_VERSION := 0.12.8

vendor: composer.json
composer install

vendor/bin/phpstan: vendor
curl -sfL https://github.com/phpstan/phpstan/releases/download/$(PHPSTAN_VERSION)/phpstan.phar -o vendor/bin/phpstan
chmod +x vendor/bin/phpstan

vendor/bin/phpdoc: vendor
curl -sfL https://github.com/phpDocumentor/phpDocumentor/releases/download/$(PHPDOCUMENTOR_VERSION)/phpDocumentor.phar -o vendor/bin/phpdoc
chmod +x vendor/bin/phpdoc

test: vendor
vendor/bin/phpunit
.PHONY: test
Expand All @@ -13,10 +20,17 @@ fmt: vendor
vendor/bin/php-cs-fixer fix -v --using-cache=no .
.PHONY: fmt

phpstan: vendor
fmtcheck: vendor
vendor/bin/php-cs-fixer fix -v --dry-run --using-cache=no .
.PHONY: fmtcheck

phpdoc: vendor/bin/phpdoc
vendor/bin/phpdoc

phpstan: vendor/bin/phpstan
vendor/bin/phpstan analyse lib tests
.PHONY: phpstan

phpstan-baseline: vendor
phpstan-baseline: vendor/bin/phpstan
vendor/bin/phpstan analyse --error-format baselineNeon lib tests > phpstan-baseline.neon
.PHONY: phpstan-baseline
31 changes: 31 additions & 0 deletions phpdoc.dist.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8" ?>
<phpdocumentor
configVersion="3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.phpdoc.org"
xsi:noNamespaceSchemaLocation="data/xsd/phpdoc.xsd"
>
<paths>
<output>build/phpdoc</output>
</paths>
<version number="3.0.0">
<folder>latest</folder>
<api>
<source dsn=".">
<path>lib</path>
</source>
<output>api</output>
<ignore hidden="true" symlinks="true">
<path>build/**/*</path>
<path>examples/**/*</path>
<path>tests/**/*</path>
<path>vendor/**/*</path>
</ignore>
<extensions>
<extension>php</extension>
</extensions>
<default-package-name>stripe-php</default-package-name>
</api>
</version>
<template name="default"/>
</phpdocumentor>

0 comments on commit cbcbec1

Please sign in to comment.