Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for phpDocumentor in Makefile #873

Merged
merged 1 commit into from
Feb 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>