Skip to content

Commit 8fa407f

Browse files
kabalinpolothy
authored andcommitted
Minor fixes following PR review.
1 parent 9d68fc9 commit 8fa407f

4 files changed

Lines changed: 13 additions & 6 deletions

File tree

.travis.dist.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,6 @@ script:
4545
- moodle-plugin-ci savepoints
4646
- moodle-plugin-ci mustache
4747
- moodle-plugin-ci grunt
48+
- moodle-plugin-ci phpdoc
4849
- moodle-plugin-ci phpunit
4950
- moodle-plugin-ci behat

docs/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ The format of this change log follows the advice given at [Keep a CHANGELOG](htt
1313
- Updated [.travis.dist.yml] to install `openjdk-8-jre-headless` instead of
1414
`oracle-java8-installer` and `oracle-java8-set-default` packages. See
1515
[#83](https://github.com/blackboard-open-source/moodle-plugin-ci/issues/83) for details.
16+
- Add `moodle-plugin-ci phpdoc` check which executes
17+
[moodlehq/moodle-local_moodlecheck](https://github.com/moodlehq/moodle-local_moodlecheck.git)
18+
on the plugin.
1619

1720
## [2.4.0] - 2018-09-11
1821
### Changed

docs/TravisFileExplained.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ env:
4343
global:
4444
# This line determines which version branch of Moodle to test against.
4545
- MOODLE_BRANCH=MOODLE_35_STABLE
46-
# Optionally, it is possible to specify a different Moodle repo to use:
47-
# - MOODLE_REPO=git://github.com/username/moodle.git
4846
# This matrix is used for testing against multiple databases. So for
4947
# each version of PHP being tested, one build will be created for each
5048
# database listed here. EG: for PHP 5.6, one build will be created
@@ -54,6 +52,10 @@ env:
5452
- DB=pgsql
5553
- DB=mysqli
5654

55+
# Optionally, it is possible to specify a different Moodle repo to use
56+
# (git://github.com/moodle/moodle.git is used by default):
57+
# - MOODLE_REPO=git://github.com/username/moodle.git
58+
5759
# This lists steps that are run before the installation step.
5860
before_install:
5961
# This disables XDebug which should speed up the build.

src/Command/PHPDocCommand.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212

1313
namespace MoodlePluginCI\Command;
1414

15+
use MoodlePluginCI\Bridge\MoodlePlugin;
1516
use Symfony\Component\Console\Input\InputInterface;
1617
use Symfony\Component\Console\Output\OutputInterface;
1718
use Symfony\Component\Filesystem\Filesystem;
1819
use Symfony\Component\Process\ProcessBuilder;
19-
use MoodlePluginCI\Bridge\MoodlePlugin;
2020

2121
class PHPDocCommand extends AbstractMoodleCommand
2222
{
@@ -42,8 +42,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
4242

4343
// We need local_moodlecheck plugin to run this check.
4444
$pluginlocation = __DIR__.'/../../vendor/moodlehq/moodle-local_moodlecheck';
45-
$plugin = new MoodlePlugin($pluginlocation);
46-
$directory = $this->moodle->getComponentInstallDirectory($plugin->getComponent());
45+
$plugin = new MoodlePlugin($pluginlocation);
46+
$directory = $this->moodle->getComponentInstallDirectory($plugin->getComponent());
4747
if (!is_dir($directory)) {
4848
// Copy plugin into Moodle if it does not exist.
4949
$filesystem = new Filesystem();
@@ -54,7 +54,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
5454
ProcessBuilder::create()
5555
->setPrefix('php')
5656
->add('local/moodlecheck/cli/moodlecheck.php')
57-
->add('-p=' . $this->plugin->directory)
57+
->add('-p='.$this->plugin->directory)
5858
->add('-f=text')
5959
->setTimeout(null)
6060
->setWorkingDirectory($this->moodle->directory)
@@ -69,6 +69,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
6969
// moodlecheck.php does not return valid exit status,
7070
// We have to parse output to see if there are errors.
7171
$results = $process->getOutput();
72+
7273
return (preg_match('/\s+Line/', $results)) ? 1 : 0;
7374
}
7475
}

0 commit comments

Comments
 (0)