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 version file management.
class VersionController extends FileController
{
protected $_file = '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($version = null)
list($date, $time, $zone, $hash) = explode(' ', trim(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);
if ($hash !== $this->hash) {
$this->version = 'dev';
$version = $version ?: $this->takeGoal('bump')->version ?: $this->version ?: 'dev';
$this->getFile()->write(implode(' ', [$version, $date, $time, $zone, $hash]) . "\n");