for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* Task runner, code generator and build tool for easier continuos integration
*
* @link https://github.com/hiqdev/hidev
* @package hidev
* @license BSD-3-Clause
* @copyright Copyright (c) 2014-2016, HiQDev (http://hiqdev.com/)
*/
namespace hidev\controllers;
/**
* Goal for HiDev own version management: show and bump.
class VersionController extends FileController
{
protected $_file = '@hidev/../version';
public $version;
public $date;
public $time;
public $zone;
public $hash;
public function init()
$v = trim($this->getFile()->read());
list($this->version, $this->date, $this->time, $this->zone, $this->hash) = explode(' ', $v);
}
public function actionMake()
echo "HiDev version $this->version $this->date $this->time $this->hash\n";
public function actionBump($version = null)
$gitinfo = reset($this->exec('git', ['log', '-n', 1, '--pretty=%ai %H']));
$this->exec('git', array... 1, '--pretty=%ai %H'))
reset()
$array
array('log', '-n', 1, '--pretty=%ai %H')
array<integer,string|int...integer","3":"string"}>
string
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example:
function acceptsInteger($int) { } $x = '123'; // string "123" // Instead of acceptsInteger($x); // we recommend to use acceptsInteger((integer) $x);
$version = $version ?: $this->takeGoal('bump')->version ?: $this->version ?: 'dev';
$this->getFile()->write("$version $gitinfo\n");