2017 © Pedro Peláez
 

library unknown

Unknown type for PHP

image

phpextra/unknown

Unknown type for PHP

  • Thursday, April 2, 2015
  • by jkobus
  • Repository
  • 1 Watchers
  • 0 Stars
  • 5,554 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 1 % Grown

The README.md

UnknownType (PHPExtra\Type\UnknownType)

Latest Stable Version Total Downloads License Build Status Scrutinizer Code Quality Code Coverage GitTip, (*1)

Usage

It should not happen but sometimes does - you have a method with many different response types, but want to handle it like a pro:, (*2)

$messedUpResponse = $api->getMeSomeChickens(); // returns "Chicken" **or** "Collection" **of** "Chickens" **or** "no" as an error response :-)

$result = new UnknownType($messedUpResponse);

if($result->isCollection()){
    $result->getAsCollection()->sort($sorter);
    ...
}elseif($result->isException){
    throw $result->getAsException();
    ...
}

UnknownType can be extended and customized :-), (*3)

Installation (Composer)

{
    "require": {
        "phpextra/unknown":"~1.0"
    }
}

Changelog

No releases yet

Contributing

All code contributions must go through a pull request. Fork the project, create a feature branch, and send me a pull request. To ensure a consistent code base, you should make sure the code follows the coding standards. If you would like to help take a look at the list of issues., (*4)

Requirements

See composer.json for a full list of dependencies.

Authors

Jacek Kobus - <kobus.jacek@gmail.com>

License information

See the file LICENSE.txt for copying permission.on.

The Versions

02/04 2015

dev-master

9999999-dev https://github.com/phpextra/unknown

Unknown type for PHP

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Jacek Kobus

unknown type object wrapper

01/04 2015

dev-unknown-1

dev-unknown-1 https://github.com/phpextra/unknown

Unknown type for PHP

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Jacek Kobus

unknown type object wrapper