Skip to content

Commit

Permalink
Merge pull request #322 from cakephp/fix-seed-task
Browse files Browse the repository at this point in the history
Fix baking a seed class
  • Loading branch information
HavokInspiration authored Aug 5, 2017
2 parents 419e044 + 8e76e7d commit 90d427d
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ before_script:

script:
- sh -c "if [ '$DEFAULT' = '1' ]; then vendor/bin/phpunit --stderr; fi"
- sh -c "if [ '$PHPSTAN' = '1' ]; then composer require --dev phpstan/phpstan:^0.6 && vendor/bin/phpstan analyse -c phpstan.neon -l 1 src; fi"
- sh -c "if [ '$PHPSTAN' = '1' ]; then composer require --dev phpstan/phpstan:^0.8 && vendor/bin/phpstan analyse -c phpstan.neon -l 1 src; fi"
- sh -c "if [ '$CODECOVERAGE' = '1' ]; then phpdbg -qrr vendor/bin/phpunit --coverage-clover=clover.xml || true; fi"
- sh -c "if [ '$CODECOVERAGE' = '1' ]; then wget -O codecov.sh https://codecov.io/bash; fi"
- sh -c "if [ '$CODECOVERAGE' = '1' ]; then bash codecov.sh; fi"
Expand Down
4 changes: 3 additions & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ services:
-
class: Migrations\PHPStan\ShellPropertiesClassReflectionExtension
tags:
- phpstan.broker.propertiesClassReflectionExtension
- phpstan.broker.propertiesClassReflectionExtension
parameters:
bootstrap: tests/PHPStan/bootstrap.phpstan.php
9 changes: 2 additions & 7 deletions src/Shell/Task/SeedTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

/**
* Task class for generating seed files.
*
* @property \Bake\Shell\Task\BakeTemplateTask
*/
class SeedTask extends SimpleBakeTask
{
Expand All @@ -32,13 +34,6 @@ class SeedTask extends SimpleBakeTask
*/
public $pathFragment = 'config/Seeds/';

/**
* BakeTemplate instance.
*
* @var \Bake\Shell\Task\BakeTemplateTask
*/
public $BakeTemplate;

/**
* {@inheritDoc}
*/
Expand Down
10 changes: 10 additions & 0 deletions tests/PHPStan/BakeTemplatePropertyReflection.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,14 @@ public function getType(): Type
{
return $this->type;
}

public function isReadable(): bool
{
return true;
}

public function isWritable(): bool
{
return true;
}
}
16 changes: 16 additions & 0 deletions tests/PHPStan/bootstrap.phpstan.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php
/**
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
define('ROOT', '');
define('APP', 'app');
define('PHINX_VERSION', '0.8.1');

0 comments on commit 90d427d

Please sign in to comment.