Giter Club home page Giter Club logo

php-by-contract's Introduction

php-by-contract (deprecated)

A lightweight design by contract library for PHP

Latest Stable Version Total Downloads License Build Status Scrutinizer Code Quality Code Coverage

Introduction

What is php-by-contract?

php-by-contract strives to be a lightweight Design by Contract library for PHP which can be added with minimal changes to any existing projects. With Design by Contract you can enforce the object oriented structure of your code and secure the interaction of these objects with one another.

Deprecation

This repository is no longer under development nor is it maintained! If you want to use Design by contract have a look at Doppelgaenger. It will be maintained instead of this repository and additionally offers AOP features as well.

php-by-contract's People

Contributors

wagnert avatar wick-ed avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

wagnert wick-ed

php-by-contract's Issues

Classname[] results in validation error

Shorthand for Array, e.g.

/**

  • all available commands
  • @var Command[]
    */
    private $commands;

..results in Validation error, because Comand[] cannot be instantiates.

I fixed it very low-level in InstanceAssertion.php ( Line 70 ):

$this->class = str_replace('[]', '', $this->class);

I know its a quick and dirty fix...

Please come up with a solution if i completely wrong, but i think this short-hand is common or?

Cloud not load Custom Config File

Hi wick-ed,
today I try to use your simple library in simple sample project.
I think it is not good idea I must create a Configuration file in my vendor dir.
I try to load costume File with but that is to late and i get the Uncaught exception 'Exception' with message 'Attempt to load invalid ... ...
You can fix this Problem i add my sample Code.

namespace pbc_test;

define("APP_ROOT", __DIR__);

require_once APP_ROOT . "/vendor/techdivision/php-by-contract/src/TechDivision/PBC/Bootstrap.php";

Config::load(__DIR__. 'config.default.json');


Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.