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:
directories:
- cache
- vendor
- $HOME/.composer/cache
@ -41,19 +40,17 @@ jobs:
- wget https://scrutinizer-ci.com/ocular.phar
- php ocular.phar code-coverage:upload --format=php-clover tests/coverage-clover.xml
- stage: API documentation
php: 7.2
- stage: API documentations
if: tag is present
php: 7.4
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:
- git fetch origin master:master
- 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
- php phpDocumentor.phar --directory src/ --target docs/api
deploy:
provider: pages
skip-cleanup: true
local-dir: build
local-dir: docs/api
github-token: $GITHUB_TOKEN
on:
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
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).

View File

@ -89,7 +89,7 @@ architecture](./topics/architecture.md),
[accessing cells](./topics/accessing-cells.md) and
[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

View File

@ -3,12 +3,12 @@
The following pages offer you some widely-used PhpSpreadsheet recipes.
Please note that these do NOT offer complete documentation on specific
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
](#setting-a-worksheets-page-orientation-and-size) covers setting a page
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
@ -301,7 +301,7 @@ $spreadsheet->getActiveSheet()->getPageSetup()
```
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

View File

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