1. Go to this page and download the library: Download php-deal/framework library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
namespace Vendor\Namespace;
use PhpDeal\Annotation as Contract; //import DbC annotations
/**
* Some account class
*/
class Account
{
/**
* Current balance
*
* @var float
*/
protected $balance = 0.0;
/**
* Deposits fixed amount of money to the account
*
* @param float $amount
*
* @Contract\Verify("$amount>0 && is_numeric($amount)")
* @Contract\Ensure("$this->balance == $__old->balance+$amount")
*/
public function deposit($amount)
{
$this->balance += $amount;
}
}
namespace Vendor\Namespace;
use PhpDeal\Annotation as Contract; //import DbC annotations
/**
* Some account class
*
* @Contract\Invariant("$this->balance > 0")
*/
class Account
{
/**
* Current balance
*
* @var float
*/
protected $balance = 0.0;
/**
* Deposits fixed amount of money to the account
*
* @param float $amount
*/
public function deposit($amount)
{
$this->balance += $amount;
}
}
class Foo extends FooParent
{
/**
* @param int $amount
* @Contract\Verify("$amount != 1")
*/
public function bar($amount)
{
...
}
}
class FooParent
{
/**
* @param int $amount
* @Contract\Verify("$amount != 2")
*/
public function bar($amount)
{
...
}
}
class Foo extends FooParent
{
/**
* @param int $amount
* @Contract\Verify("$amount != 1")
* {@inheritdoc}
*/
public function bar($amount)
{
...
}
}
class FooParent
{
/**
* @param int $amount
* @Contract\Verify("$amount != 2")
*/
public function bar($amount)
{
...
}
}
/**
* @Contract\Invariant("$this->amount != 1")
*/
class Foo extends FooParent
{
}
/**
* @Contract\Invariant("$this->amount != 2")
*/
class FooParent
{
/**
* @var int
*/
protected $amount;
/**
* @param int $amount
*/
protected function setBar($amount)
{
$this->amount = $amount;
}
}
class Foo extends FooParent
{
/**
* @param int $amount
* @Contract\Inherit
*/
public function bar($amount)
{
...
}
}
class FooParent
{
/**
* @param int $amount
* @Contract\Verify("$amount != 2")
*/
public function bar($amount)
{
...
}
}
/**
* Deposits fixed amount of money to the account
*
* @param float $amount
*
* @Contract\Ensure("Assert\Assertion::integer($this->balance)")
*/
public function deposit($amount)
{
$this->balance += $amount;
}
Fatal error: Uncaught Error: Class 'Go\ParserReflection\Instrument\PathResolver'
not found in .../vendor/goaop/parser-reflection/src/ReflectionEngine.php on line XXX