Replace Sami with phpDocumentor 3

Because Sami is deprecated and now raise errors. We lose API
docs for multiple versions but we still have latest version with low
maintenance cost.
This commit is contained in:
Adrien Crivelli 2020-04-05 17:46:03 +09:00
parent 5daa38f456
commit 57c36e01d5
No known key found for this signature in database
GPG Key ID: B182FD79DC6DE92E
6 changed files with 17 additions and 44 deletions

View File

@ -1,24 +0,0 @@
<?php
use Sami\RemoteRepository\GitHubRemoteRepository;
use Sami\Sami;
use Sami\Version\GitVersionCollection;
use Symfony\Component\Finder\Finder;
$iterator = Finder::create()
->files()
->name('*.php')
->in($dir = __DIR__ . '/src');
$versions = GitVersionCollection::create($dir)
->addFromTags(function ($version) {
return preg_match('~^\d+\.\d+\.\d+$~', $version);
})
->add('master');
return new Sami($iterator, [
'title' => 'PhpSpreadsheet',
'versions' => $versions,
'build_dir' => __DIR__ . '/build/%version%',
'cache_dir' => __DIR__ . '/cache/%version%',
'remote_repository' => new GitHubRemoteRepository('PHPOffice/PhpSpreadsheet', dirname($dir)),
]);

View File

@ -9,7 +9,6 @@ php:
cache: cache:
directories: directories:
- cache
- vendor - vendor
- $HOME/.composer/cache - $HOME/.composer/cache
@ -41,19 +40,17 @@ jobs:
- wget https://scrutinizer-ci.com/ocular.phar - wget https://scrutinizer-ci.com/ocular.phar
- php ocular.phar code-coverage:upload --format=php-clover tests/coverage-clover.xml - php ocular.phar code-coverage:upload --format=php-clover tests/coverage-clover.xml
- stage: API documentation - stage: API documentations
php: 7.2 if: tag is present
php: 7.4
before_script: before_script:
- curl -O https://get.sensiolabs.org/sami.phar - curl -O https://github.com/phpDocumentor/phpDocumentor/releases/download/v3.0.0-rc/phpDocumentor.phar
script: script:
- git fetch origin master:master - php phpDocumentor.phar --directory src/ --target docs/api
- git fetch origin --tags
- php sami.phar update .sami.php
- echo '<html><head><meta http-equiv="Refresh" content="0; url=master/"></head><body><p>If you are not automatically redirected, please go to <a href="master/">the latest stable API documentation</a>.</p></body></html>' > build/index.html
deploy: deploy:
provider: pages provider: pages
skip-cleanup: true skip-cleanup: true
local-dir: build local-dir: docs/api
github-token: $GITHUB_TOKEN github-token: $GITHUB_TOKEN
on: on:
all_branches: true all_branches: true

View File

@ -12,7 +12,7 @@ PhpSpreadsheet is a library written in pure PHP and providing a set of classes t
## Documentation ## Documentation
Read more about it, including install instructions, in the [official documentation](https://phpspreadsheet.readthedocs.io). Or check out the [API documentation](https://phpoffice.github.io/PhpSpreadsheet/master). Read more about it, including install instructions, in the [official documentation](https://phpspreadsheet.readthedocs.io). Or check out the [API documentation](https://phpoffice.github.io/PhpSpreadsheet).
Please ask your support questions on [StackOverflow](https://stackoverflow.com/questions/tagged/phpspreadsheet), or have a quick chat on [Gitter](https://gitter.im/PHPOffice/PhpSpreadsheet). Please ask your support questions on [StackOverflow](https://stackoverflow.com/questions/tagged/phpspreadsheet), or have a quick chat on [Gitter](https://gitter.im/PHPOffice/PhpSpreadsheet).

View File

@ -89,7 +89,7 @@ architecture](./topics/architecture.md),
[accessing cells](./topics/accessing-cells.md) and [accessing cells](./topics/accessing-cells.md) and
[reading and writing to files](./topics/reading-and-writing-to-file.md). [reading and writing to files](./topics/reading-and-writing-to-file.md).
Or browse the [API documentation](https://phpoffice.github.io/PhpSpreadsheet/master). Or browse the [API documentation](https://phpoffice.github.io/PhpSpreadsheet).
# Credits # Credits

View File

@ -3,12 +3,12 @@
The following pages offer you some widely-used PhpSpreadsheet recipes. The following pages offer you some widely-used PhpSpreadsheet recipes.
Please note that these do NOT offer complete documentation on specific Please note that these do NOT offer complete documentation on specific
PhpSpreadsheet API functions, but just a bump to get you started. If you PhpSpreadsheet API functions, but just a bump to get you started. If you
need specific API functions, please refer to the [API documentation](https://phpoffice.github.io/PhpSpreadsheet/master). need specific API functions, please refer to the [API documentation](https://phpoffice.github.io/PhpSpreadsheet).
For example, [setting a worksheet's page orientation and size For example, [setting a worksheet's page orientation and size
](#setting-a-worksheets-page-orientation-and-size) covers setting a page ](#setting-a-worksheets-page-orientation-and-size) covers setting a page
orientation to A4. Other paper formats, like US Letter, are not covered orientation to A4. Other paper formats, like US Letter, are not covered
in this document, but in the PhpSpreadsheet [API documentation](https://phpoffice.github.io/PhpSpreadsheet/master). in this document, but in the PhpSpreadsheet [API documentation](https://phpoffice.github.io/PhpSpreadsheet).
## Setting a spreadsheet's metadata ## Setting a spreadsheet's metadata
@ -301,7 +301,7 @@ $spreadsheet->getActiveSheet()->getPageSetup()
``` ```
Note that there are additional page settings available. Please refer to Note that there are additional page settings available. Please refer to
the [API documentation](https://phpoffice.github.io/PhpSpreadsheet/master) for all possible options. the [API documentation](https://phpoffice.github.io/PhpSpreadsheet) for all possible options.
### Page Setup: Scaling options ### Page Setup: Scaling options

View File

@ -180,7 +180,7 @@ class PageSetup
* Print scaling. Valid values range from 10 to 400 * Print scaling. Valid values range from 10 to 400
* This setting is overridden when fitToWidth and/or fitToHeight are in use * This setting is overridden when fitToWidth and/or fitToHeight are in use
* *
* @var int? * @var null|int
*/ */
private $scale = 100; private $scale = 100;
@ -196,7 +196,7 @@ class PageSetup
* Fit To Height * Fit To Height
* Number of vertical pages to fit on. * Number of vertical pages to fit on.
* *
* @var int? * @var null|int
*/ */
private $fitToHeight = 1; private $fitToHeight = 1;
@ -204,7 +204,7 @@ class PageSetup
* Fit To Width * Fit To Width
* Number of horizontal pages to fit on. * Number of horizontal pages to fit on.
* *
* @var int? * @var null|int
*/ */
private $fitToWidth = 1; private $fitToWidth = 1;
@ -308,7 +308,7 @@ class PageSetup
/** /**
* Get Scale. * Get Scale.
* *
* @return int? * @return null|int
*/ */
public function getScale() public function getScale()
{ {
@ -370,7 +370,7 @@ class PageSetup
/** /**
* Get Fit To Height. * Get Fit To Height.
* *
* @return int? * @return null|int
*/ */
public function getFitToHeight() public function getFitToHeight()
{ {
@ -398,7 +398,7 @@ class PageSetup
/** /**
* Get Fit To Width. * Get Fit To Width.
* *
* @return int? * @return null|int
*/ */
public function getFitToWidth() public function getFitToWidth()
{ {