Skip to content

Commit

Permalink
Merge pull request #195 from williamdes/issue-194-apigen
Browse files Browse the repository at this point in the history
Replace apigen with Sami in CI
  • Loading branch information
nijel authored Jun 9, 2018
2 parents ffd2d89 + 981c499 commit e096412
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 4 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ matrix:
allow_failures:
- php: "nightly"
include:
- php: "7.1"
- php: "7.2"
env: DOCS=yes
- php: "7.1"
env: REQUIRE="phpmyadmin/motranslator:^3.0"
Expand All @@ -29,7 +29,7 @@ matrix:
sudo: false

install:
- if [ "$TRAVIS_PHP_VERSION" = "5.3" ] ; then sed -i '/apigen/D' composer.json ; fi
- if [ $(php -r "echo PHP_MAJOR_VERSION;") -lt 7 ] ; then sed -i '/sami/D' composer.json ; fi
- if [ -n "$REQUIRE" ] ; then composer require "$REQUIRE" ; fi
- composer install

Expand All @@ -42,4 +42,4 @@ cache:

script:
- if [ "$DOCS" != "yes" ] ; then ./vendor/bin/phpunit --configuration phpunit.xml ; fi
- if [ "$DOCS" = "yes" ] ; then ./vendor/bin/apigen generate --destination doc --source src/ ; fi
- if [ "$DOCS" = "yes" ] ; then ./vendor/bin/sami.php --no-interaction update ./tools/sami-config.php ; fi
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"symfony/polyfill-mbstring": "^1.3"
},
"require-dev": {
"apigen/apigen": "^4.1",
"sami/sami": "^4.0",
"phpunit/php-code-coverage": "*",
"phpunit/phpunit": "~4.8 || ~5.7 || ~6.5"
},
Expand Down
1 change: 1 addition & 0 deletions src/Components/CaseExpression.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ public function __construct()
/**
* @param Parser $parser the parser that serves as context
* @param TokensList $list the list of tokens that are being parsed
* @param array $options parameters for parsing
*
* @return CaseExpression
*/
Expand Down
22 changes: 22 additions & 0 deletions tools/sami-config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

<?php
/**
* This file has been generated by phpmyadmin/scripts:/develdocs/build.sh
* @see https://github.com/phpmyadmin/scripts/blob/master/develdocs/sami.php
* @see https://github.com/phpmyadmin/scripts/blob/master/develdocs/build.sh
*/
use Sami\Sami;
use Symfony\Component\Finder\Finder;

$iterator = Finder::create()
->files()
->name("*.php")
->in("./src")
;

return new Sami($iterator, array(
"title" => "A validating SQL lexer and parser with a focus on MySQL dialect.",
"build_dir" => "./doc/",
"cache_dir" => "./tmp"
));

0 comments on commit e096412

Please sign in to comment.